doc-exports/docs/kms/api-ref/kms_02_0041.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

166 lines
14 KiB
HTML

<a name="kms_02_0041"></a><a name="kms_02_0041"></a>
<h1 class="topictitle1">Querying the Rotation Status of a CMK</h1>
<div id="body1511418825778"><div class="section" id="kms_02_0041__en-us_topic_0112992305_s1731a14fb0144c79bf0fa90c694f34f7"><h4 class="sectiontitle">Function</h4><p id="kms_02_0041__en-us_topic_0112992305_en-us_topic_0020091565_p23115188">This API enables you to query the rotation status of a CMK.</p>
</div>
<div class="section" id="kms_02_0041__en-us_topic_0112992305_se70c3e5518a04f60b06032524dddfef4"><h4 class="sectiontitle">URI</h4><ul id="kms_02_0041__en-us_topic_0112992305_en-us_topic_0020091565_ul60390938"><li id="kms_02_0041__en-us_topic_0112992305_en-us_topic_0020091565_li6647531">URI format<p id="kms_02_0041__en-us_topic_0112992305_p138073181080"><a name="kms_02_0041__en-us_topic_0112992305_en-us_topic_0020091565_li6647531"></a><a name="en-us_topic_0112992305_en-us_topic_0020091565_li6647531"></a>POST /v1.0/{project_id}/kms/get-key-rotation-status</p>
</li><li id="kms_02_0041__en-us_topic_0112992305_en-us_topic_0020091565_li14211994">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0041__en-us_topic_0112992305_t982da1e0196d4ec1a28d1fbff2cc8191" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="kms_02_0041__en-us_topic_0112992305_r6e963322c1e740d181726d2f0e91df5a"><th align="left" class="cellrowborder" valign="top" width="19.170000000000005%" id="mcps1.3.2.2.2.1.2.5.1.1"><p id="kms_02_0041__en-us_topic_0112992305_p2739096916511"><strong id="kms_02_0041__en-us_topic_0112992305_b842352706202545">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="22.180000000000003%" id="mcps1.3.2.2.2.1.2.5.1.2"><p id="kms_02_0041__en-us_topic_0112992305_p407603016511">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.610000000000003%" id="mcps1.3.2.2.2.1.2.5.1.3"><p id="kms_02_0041__en-us_topic_0112992305_p6172299916511">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="40.040000000000006%" id="mcps1.3.2.2.2.1.2.5.1.4"><p id="kms_02_0041__en-us_topic_0112992305_p3350702116511">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0041__en-us_topic_0112992305_r69bf37b65d3f446eab7b3f4d1b2fcec0"><td class="cellrowborder" valign="top" width="19.170000000000005%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="kms_02_0041__en-us_topic_0112992305_ae42d73592f58424ea93a11e52d2478dd">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="22.180000000000003%" headers="mcps1.3.2.2.2.1.2.5.1.2 "><p id="kms_02_0041__en-us_topic_0112992305_a56440c0f0ae34ba3b8033d1247673984">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="18.610000000000003%" headers="mcps1.3.2.2.2.1.2.5.1.3 "><p id="kms_02_0041__en-us_topic_0112992305_p4386100291125">String</p>
</td>
<td class="cellrowborder" valign="top" width="40.040000000000006%" headers="mcps1.3.2.2.2.1.2.5.1.4 "><p id="kms_02_0041__en-us_topic_0112992305_a1314869d2dc147b38461e037d622f7b4">Project ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="kms_02_0041__en-us_topic_0112992305_seb7b7901701247fab30a59b76f1c7f93"><h4 class="sectiontitle">Requests</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0041__en-us_topic_0112992305_table46221022101230" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="kms_02_0041__en-us_topic_0112992305_row9315574101230"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.5.1.1"><p id="kms_02_0041__en-us_topic_0112992305_p588193020561"><strong id="kms_02_0041__en-us_topic_0112992305_b1848255014">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_0041__en-us_topic_0112992305_p15880308565">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.5.1.3"><p id="kms_02_0041__en-us_topic_0112992305_p14881230145613">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_0041__en-us_topic_0112992305_p28811306563">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0041__en-us_topic_0112992305_row2638193101722"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0041__en-us_topic_0112992305_p41908563105428">key_id</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0041__en-us_topic_0112992305_p17072096105428">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0041__en-us_topic_0112992305_p1382011218818">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0041__en-us_topic_0112992305_p65699359161410">36-byte ID of a CMK that matches the regular expression <span class="parmvalue" id="kms_02_0041__en-us_topic_0112992305_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_0041__en-us_topic_0112992305_p40662515105428">Example: 0d0466b0-e727-4d9c-b35d-f84bb474a37f</p>
</td>
</tr>
<tr id="kms_02_0041__en-us_topic_0112992305_row35142504101726"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0041__en-us_topic_0112992305_p269135101746">sequence</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0041__en-us_topic_0112992305_p20967256101746">No</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0041__en-us_topic_0112992305_p3331191510818">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0041__en-us_topic_0112992305_p1692914716294">36-byte serial number of a request message</p>
<p id="kms_02_0041__en-us_topic_0112992305_p20626198101746">Example: 919c82d4-8046-4722-9094-35c3c6524cff</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="kms_02_0041__en-us_topic_0112992305_sfadd53a5f4714e8f87811818d62d0296"><h4 class="sectiontitle">Responses</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0041__en-us_topic_0112992305_table166431040746" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameters</caption><thead align="left"><tr id="kms_02_0041__en-us_topic_0112992305_row166441940847"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.2.2.5.1.1"><p id="kms_02_0041__en-us_topic_0112992305_p1264419406413"><strong id="kms_02_0041__en-us_topic_0112992305_b1790645517">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.4.2.2.5.1.2"><p id="kms_02_0041__en-us_topic_0112992305_p206441240446">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.2.2.5.1.3"><p id="kms_02_0041__en-us_topic_0112992305_p564417401849">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.2.2.5.1.4"><p id="kms_02_0041__en-us_topic_0112992305_p106441340047">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0041__en-us_topic_0112992305_row0644124016413"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.1 "><p id="kms_02_0041__en-us_topic_0112992305_p06449401044">key_rotation_enabled</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.2.5.1.2 "><p id="kms_02_0041__en-us_topic_0112992305_p4644640543">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.3 "><p id="kms_02_0041__en-us_topic_0112992305_p66447406416">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.5.1.4 "><p id="kms_02_0041__en-us_topic_0112992305_p969917147612">Key rotation status. The default value is <strong id="kms_02_0041__en-us_topic_0112992305_b8423527069926">false</strong>, indicating that key rotation is disabled.</p>
</td>
</tr>
<tr id="kms_02_0041__en-us_topic_0112992305_row264454013411"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.1 "><p id="kms_02_0041__en-us_topic_0112992305_p1364419401419">rotation_interval</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.2.5.1.2 "><p id="kms_02_0041__en-us_topic_0112992305_p864415408414">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.3 "><p id="kms_02_0041__en-us_topic_0112992305_p164454010419">Integer</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.5.1.4 "><p id="kms_02_0041__en-us_topic_0112992305_p66921814364">Rotation interval. The value is an integer ranging from <strong id="kms_02_0041__en-us_topic_0112992305_b842352706113339">30</strong> to <strong id="kms_02_0041__en-us_topic_0112992305_b842352706113343">365</strong>.</p>
<p id="kms_02_0041__en-us_topic_0112992305_p12244341395">Set the interval based on how often a CMK is used. If it is frequently used, set a short interval; otherwise, set a long one.</p>
</td>
</tr>
<tr id="kms_02_0041__en-us_topic_0112992305_row52711533956"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.1 "><p id="kms_02_0041__en-us_topic_0112992305_p1727163317516">last_rotation_time</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.2.5.1.2 "><p id="kms_02_0041__en-us_topic_0112992305_p192718332517">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.3 "><p id="kms_02_0041__en-us_topic_0112992305_p15769181711612">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.5.1.4 "><p id="kms_02_0041__en-us_topic_0112992305_p142711332515">Last key rotation time. The value is a timestamp expressed in the number of seconds since 00:00:00 UTC on January 1, 1970.</p>
</td>
</tr>
<tr id="kms_02_0041__en-us_topic_0112992305_row196153018510"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.1 "><p id="kms_02_0041__en-us_topic_0112992305_p179811301653">number_of_rotations</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.2.2.5.1.2 "><p id="kms_02_0041__en-us_topic_0112992305_p6981030258">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.2.2.5.1.3 "><p id="kms_02_0041__en-us_topic_0112992305_p1638420181761">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.2.2.5.1.4 "><p id="kms_02_0041__en-us_topic_0112992305_p598173013511">Number of key rotations</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="kms_02_0041__en-us_topic_0112992305_section1776515304561"><h4 class="sectiontitle">Examples</h4><ul id="kms_02_0041__en-us_topic_0112992305_ul378993055613"><li id="kms_02_0041__en-us_topic_0112992305_li1078719301561">Example request<pre class="screen" id="kms_02_0041__en-us_topic_0112992305_screen17787103065620">{
"key_id": "0d0466b0-e727-4d9c-b35d-f84bb474a37f"
}</pre>
</li><li id="kms_02_0041__en-us_topic_0112992305_li2078918305562">Example response<pre class="screen" id="kms_02_0041__en-us_topic_0112992305_screen17789330185610">{
"key_rotation_enabled": true,
"rotation_interval": 30,
"last_rotation_time": "1501578672000",
"number_of_rotations": 3
}</pre>
<p id="kms_02_0041__en-us_topic_0112992305_p178953011566">or</p>
<pre class="screen" id="kms_02_0041__en-us_topic_0112992305_screen778919300567">{
"error": {
"error_code": "KMS.XXXX",
"error_msg": "XXX"
}
}</pre>
</li></ul>
</div>
<div class="section" id="kms_02_0041__en-us_topic_0112992305_section655115613254"><h4 class="sectiontitle">Status Codes</h4><div class="p" id="kms_02_0041__en-us_topic_0112992305_en-us_topic_0112992294_en-us_topic_0079615001_p17772351"><a href="#kms_02_0041__en-us_topic_0112992305_en-us_topic_0112992294_en-us_topic_0079615001_table20596071">Table 4</a> lists the normal status code returned by the response.
<div class="tablenoborder"><a name="kms_02_0041__en-us_topic_0112992305_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><a name="en-us_topic_0112992305_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0041__en-us_topic_0112992305_en-us_topic_0112992294_en-us_topic_0079615001_table20596071" frame="border" border="1" rules="all"><caption><b>Table 4 </b>Status codes</caption><thead align="left"><tr id="kms_02_0041__en-us_topic_0112992305_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_0041__en-us_topic_0112992305_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_0041__en-us_topic_0112992305_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_0041__en-us_topic_0112992305_en-us_topic_0112992294_p30689603203043">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0041__en-us_topic_0112992305_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_0041__en-us_topic_0112992305_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_0041__en-us_topic_0112992305_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_0041__en-us_topic_0112992305_en-us_topic_0112992294_p1885682315512">Request processed successfully.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="kms_02_0041__en-us_topic_0112992305_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>