doc-exports/docs/kms/api-ref/kms_02_0029.html
Li, Qiao dfe65b9551 KMS API 20230817 version.
Reviewed-by: Belejkanic, Lukas <lukas.belejkanic@t-systems.com>
Co-authored-by: Li, Qiao <qiaoli@huawei.com>
Co-committed-by: Li, Qiao <qiaoli@huawei.com>
2024-04-02 13:42:22 +00:00

126 lines
11 KiB
HTML

<a name="kms_02_0029"></a><a name="kms_02_0029"></a>
<h1 class="topictitle1">Revoking a Grant</h1>
<div id="body1497317398920"><div class="section" id="kms_02_0029__en-us_topic_0112992289_section37533920154934"><h4 class="sectiontitle">Function</h4><p id="kms_02_0029__en-us_topic_0112992289_p30759225155040">This API allows you to revoke a grant.</p>
<div class="note" id="kms_02_0029__en-us_topic_0112992289_note2095517513589"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="kms_02_0029__en-us_topic_0112992289_p095515105814">Only the user who created the CMK can revoke a grant.</p>
</div></div>
</div>
<div class="section" id="kms_02_0029__en-us_topic_0112992289_section37627629154934"><h4 class="sectiontitle">URI</h4><ul id="kms_02_0029__en-us_topic_0112992289_ul27939100154934"><li id="kms_02_0029__en-us_topic_0112992289_li50125315154934">URI format<p id="kms_02_0029__en-us_topic_0112992289_p48474652154934"><a name="kms_02_0029__en-us_topic_0112992289_li50125315154934"></a><a name="en-us_topic_0112992289_li50125315154934"></a>POST /v1.0/{project_id}/kms/revoke-grant</p>
</li><li id="kms_02_0029__en-us_topic_0112992289_li34132757154934">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0029__en-us_topic_0112992289_table38759358154934" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameters</caption><thead align="left"><tr id="kms_02_0029__en-us_topic_0112992289_row60644171154934"><th align="left" class="cellrowborder" valign="top" width="22.74%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="kms_02_0029__en-us_topic_0112992289_p13230838154934"><strong id="kms_02_0029__en-us_topic_0112992289_b842352706192812">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.919999999999998%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="kms_02_0029__en-us_topic_0112992289_p65064970154934"><strong id="kms_02_0029__en-us_topic_0112992289_b842352706192815">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="19.55%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="kms_02_0029__en-us_topic_0112992289_p35771181154934">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40.79%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="kms_02_0029__en-us_topic_0112992289_p11784586154934">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0029__en-us_topic_0112992289_row15027399154934"><td class="cellrowborder" valign="top" width="22.74%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="kms_02_0029__en-us_topic_0112992289_p9259788154934">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="16.919999999999998%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="kms_02_0029__en-us_topic_0112992289_p11845378154934">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="19.55%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="kms_02_0029__en-us_topic_0112992289_p4386100291125">String</p>
</td>
<td class="cellrowborder" valign="top" width="40.79%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="kms_02_0029__en-us_topic_0112992289_p5464351154934">Project ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="kms_02_0029__en-us_topic_0112992289_section49179167154934"><h4 class="sectiontitle">Requests</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0029__en-us_topic_0112992289_table5096792154934" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="kms_02_0029__en-us_topic_0112992289_row37570371154934"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.5.1.1"><p id="kms_02_0029__en-us_topic_0112992289_p176291224518"><strong id="kms_02_0029__en-us_topic_0112992289_b372002790">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.3.2.2.5.1.2"><p id="kms_02_0029__en-us_topic_0112992289_p1762412104515"><strong id="kms_02_0029__en-us_topic_0112992289_b837415329">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.5.1.3"><p id="kms_02_0029__en-us_topic_0112992289_p4762712184520">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.2.2.5.1.4"><p id="kms_02_0029__en-us_topic_0112992289_p197620128455">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0029__en-us_topic_0112992289_row3735252154934"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0029__en-us_topic_0112992289_p5492758715522">key_id</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0029__en-us_topic_0112992289_p530110015522">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0029__en-us_topic_0112992289_p115241313415">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0029__en-us_topic_0112992289_p2673593115522">36-byte ID of a CMK that matches the regular expression <span class="parmvalue" id="kms_02_0029__en-us_topic_0112992289_parmvalue80435593163333"><b>^[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}$</b></span></p>
<p id="kms_02_0029__en-us_topic_0112992289_p5898392715522">Example: 0d0466b0-e727-4d9c-b35d-f84bb474a37f</p>
</td>
</tr>
<tr id="kms_02_0029__en-us_topic_0112992289_row2233745154934"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0029__en-us_topic_0112992289_p3969076161826">grant_id</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0029__en-us_topic_0112992289_p2870774161826">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0029__en-us_topic_0112992289_p104533151948">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0029__en-us_topic_0112992289_p31206156161826">64-byte ID of a grant that meets the regular expression <strong id="kms_02_0029__en-us_topic_0112992289_b842352706105044">^[A-Fa-f0-9]{64}$</strong></p>
<p id="kms_02_0029__en-us_topic_0112992289_p7940591162038">Example: 7c9a3286af4fcca5f0a385ad13e1d21a50e27b6dbcab50f37f30f93b8939827d</p>
</td>
</tr>
<tr id="kms_02_0029__en-us_topic_0112992289_row29452288162122"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0029__en-us_topic_0112992289_p45167875162120">sequence</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0029__en-us_topic_0112992289_p60798351162120">No</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0029__en-us_topic_0112992289_p1221520171643">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0029__en-us_topic_0112992289_p25719365162120">36-byte serial number of a request message</p>
<p id="kms_02_0029__en-us_topic_0112992289_p30147697162120">Example: 919c82d4-8046-4722-9094-35c3c6524cff</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="kms_02_0029__en-us_topic_0112992289_section35819930154934"><h4 class="sectiontitle">Responses</h4><p id="kms_02_0029__en-us_topic_0112992289_p50430829201729">None</p>
</div>
<div class="section" id="kms_02_0029__en-us_topic_0112992289_section16883113220574"><h4 class="sectiontitle">Examples</h4><p id="kms_02_0029__en-us_topic_0112992289_p26581152012">The following example describes how to revoke a grant whose grant ID is <span class="parmvalue" id="kms_02_0029__en-us_topic_0112992289_parmvalue869049923193026"><b>7c9a3286af4fcca5f0a385ad13e1d21a50e27b6dbcab50f37f30f93b8939827d</b></span> and the CMK ID is <span class="parmvalue" id="kms_02_0029__en-us_topic_0112992289_parmvalue151618583193044"><b>bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e</b></span>.</p>
<ul id="kms_02_0029__en-us_topic_0112992289_ul5794242205711"><li id="kms_02_0029__en-us_topic_0112992289_li16718172155717">Example request<pre class="screen" id="kms_02_0029__en-us_topic_0112992289_screen6411117205719">{
"key_id": "bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e",
"grant_id":"7c9a3286af4fcca5f0a385ad13e1d21a50e27b6dbcab50f37f30f93b8939827d"
}</pre>
</li><li id="kms_02_0029__en-us_topic_0112992289_li38339984154934">Example response<pre class="screen" id="kms_02_0029__en-us_topic_0112992289_screen9515540154934">{
}</pre>
<p id="kms_02_0029__en-us_topic_0112992289_p18530999154934">or</p>
<pre class="screen" id="kms_02_0029__en-us_topic_0112992289_screen32561266154934">{
"error": {
"error_code": "KMS.XXXX",
"error_msg": "XXX"
}
}</pre>
</li></ul>
</div>
<div class="section" id="kms_02_0029__en-us_topic_0112992289_section3454223421"><h4 class="sectiontitle">Status Codes</h4><div class="p" id="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_en-us_topic_0079615001_p17772351"><a href="#kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_en-us_topic_0079615001_table20596071">Table 3</a> lists the normal status code returned by the response.
<div class="tablenoborder"><a name="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><a name="en-us_topic_0112992289_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_en-us_topic_0079615001_table20596071" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Status codes</caption><thead align="left"><tr id="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_en-us_topic_0079615001_row9746163"><th align="left" class="cellrowborder" valign="top" width="16.16%" id="mcps1.3.6.2.2.2.4.1.1"><p id="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_p57545694203043">Status Code</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.28%" id="mcps1.3.6.2.2.2.4.1.2"><p id="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_p4531342288">Status</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="55.559999999999995%" id="mcps1.3.6.2.2.2.4.1.3"><p id="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_p30689603203043">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_en-us_topic_0079615001_row48621261"><td class="cellrowborder" valign="top" width="16.16%" headers="mcps1.3.6.2.2.2.4.1.1 "><p id="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_en-us_topic_0079615001_p46008046">200</p>
</td>
<td class="cellrowborder" valign="top" width="28.28%" headers="mcps1.3.6.2.2.2.4.1.2 "><p id="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_p7538425819">OK</p>
</td>
<td class="cellrowborder" valign="top" width="55.559999999999995%" headers="mcps1.3.6.2.2.2.4.1.3 "><p id="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_p1885682315512">Request processed successfully.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="kms_02_0029__en-us_topic_0112992289_en-us_topic_0112992294_p5626181018551">Exception status code. For details, see <a href="kms_02_0301.html#kms_02_0301">Status Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="kms_02_0011.html">CMK Management</a></div>
</div>
</div>