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

183 lines
16 KiB
HTML

<a name="kms_02_0026"></a><a name="kms_02_0026"></a>
<h1 class="topictitle1">Changing the Alias of a CMK</h1>
<div id="body1497317398920"><div class="section" id="kms_02_0026__en-us_topic_0112992307_section6685482991125"><h4 class="sectiontitle">Function</h4><p id="kms_02_0026__en-us_topic_0112992307_p5367360791240">This API enables you to change the alias of a CMK.</p>
<div class="note" id="kms_02_0026__en-us_topic_0112992307_note1613564791125"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><ul id="kms_02_0026__en-us_topic_0112992307_ul54363724143345"><li id="kms_02_0026__en-us_topic_0112992307_li1133304143345">A Default Master Key (the alias suffix of which is <strong id="kms_02_0026__en-us_topic_0112992307_b842352706101914">/default</strong>) does not allow alias changes.</li><li id="kms_02_0026__en-us_topic_0112992307_li53635899143345">A CMK in <strong id="kms_02_0026__en-us_topic_0112992307_b842352706145032">Scheduled deletion</strong> status does not allow alias changes.</li></ul>
</div></div>
</div>
<div class="section" id="kms_02_0026__en-us_topic_0112992307_section3191906891125"><h4 class="sectiontitle">URI</h4><ul id="kms_02_0026__en-us_topic_0112992307_ul3530770591125"><li id="kms_02_0026__en-us_topic_0112992307_li4933389191125">URI format<p id="kms_02_0026__en-us_topic_0112992307_p2792598191327"><a name="kms_02_0026__en-us_topic_0112992307_li4933389191125"></a><a name="en-us_topic_0112992307_li4933389191125"></a>POST /v1.0/{project_id}/kms/update-key-alias</p>
</li><li id="kms_02_0026__en-us_topic_0112992307_li3662222891125">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0026__en-us_topic_0112992307_table6116459691125" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="kms_02_0026__en-us_topic_0112992307_row2741617991125"><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_0026__en-us_topic_0112992307_p611804291125"><strong id="kms_02_0026__en-us_topic_0112992307_b84235270619643">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_0026__en-us_topic_0112992307_p2579942291125"><strong id="kms_02_0026__en-us_topic_0112992307_b84235270619645">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_0026__en-us_topic_0112992307_p937843891125">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_0026__en-us_topic_0112992307_p2145602791125">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0026__en-us_topic_0112992307_row6021661291125"><td class="cellrowborder" valign="top" width="22.74%" headers="mcps1.3.2.2.2.1.2.5.1.1 "><p id="kms_02_0026__en-us_topic_0112992307_p4570740291125">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_0026__en-us_topic_0112992307_p1131205291125">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_0026__en-us_topic_0112992307_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_0026__en-us_topic_0112992307_p6308031091125">Project ID</p>
</td>
</tr>
</tbody>
</table>
</div>
</li></ul>
</div>
<div class="section" id="kms_02_0026__en-us_topic_0112992307_section3085187891125"><h4 class="sectiontitle">Requests</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0026__en-us_topic_0112992307_table6419419691821" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="kms_02_0026__en-us_topic_0112992307_row3033405791821"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.5.1.1"><p id="kms_02_0026__en-us_topic_0112992307_p4113955391821"><strong id="kms_02_0026__en-us_topic_0112992307_b484745754">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_0026__en-us_topic_0112992307_p476054391821"><strong id="kms_02_0026__en-us_topic_0112992307_b84235270619717">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_0026__en-us_topic_0112992307_p4396951091821"><strong id="kms_02_0026__en-us_topic_0112992307_b84235270619712">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.2.2.5.1.4"><p id="kms_02_0026__en-us_topic_0112992307_p5005970191821">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0026__en-us_topic_0112992307_row2830395191821"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0026__en-us_topic_0112992307_p3801801143225">key_id</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0026__en-us_topic_0112992307_p46233878143225">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0026__en-us_topic_0112992307_p7551153620218">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0026__en-us_topic_0112992307_p53956617143225">36-byte ID of a CMK that matches the regular expression <span class="parmvalue" id="kms_02_0026__en-us_topic_0112992307_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_0026__en-us_topic_0112992307_p10107472143225">Example: 0d0466b0-e727-4d9c-b35d-f84bb474a37f</p>
</td>
</tr>
<tr id="kms_02_0026__en-us_topic_0112992307_row601748291821"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0026__en-us_topic_0112992307_p13453928143217">key_alias</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0026__en-us_topic_0112992307_p23067306143217">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0026__en-us_topic_0112992307_p744193816210">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0026__en-us_topic_0112992307_p56512465143217">Alias of a CMK whose length is 1 to 255 characters and which matches the regular expression <strong id="kms_02_0026__en-us_topic_0112992307_b842352706112538">^[a-zA-Z0-9:/_-]{1,255}$</strong>. Suffix of the alias cannot be <strong id="kms_02_0026__en-us_topic_0112992307_b842352706112556">/default</strong>.</p>
</td>
</tr>
<tr id="kms_02_0026__en-us_topic_0112992307_row315093291821"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.1 "><p id="kms_02_0026__en-us_topic_0112992307_p5389896591821">sequence</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.5.1.2 "><p id="kms_02_0026__en-us_topic_0112992307_p3451131791821">No</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.5.1.3 "><p id="kms_02_0026__en-us_topic_0112992307_p4126174020210">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.5.1.4 "><p id="kms_02_0026__en-us_topic_0112992307_p13154914142714">36-byte serial number of a request message</p>
<p id="kms_02_0026__en-us_topic_0112992307_p4395331691821">Example: 919c82d4-8046-4722-9094-35c3c6524cff</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="kms_02_0026__en-us_topic_0112992307_section955024991125"><h4 class="sectiontitle">Responses</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0026__en-us_topic_0112992307_table7517184618545" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Response parameters</caption><thead align="left"><tr id="kms_02_0026__en-us_topic_0112992307_row55181746125413"><th align="left" class="cellrowborder" valign="top" width="18.04%" id="mcps1.3.4.2.2.5.1.1"><p id="kms_02_0026__en-us_topic_0112992307_p1151811468544"><strong id="kms_02_0026__en-us_topic_0112992307_b84235270619742">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="15.67%" id="mcps1.3.4.2.2.5.1.2"><p id="kms_02_0026__en-us_topic_0112992307_p145186465549">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.35%" id="mcps1.3.4.2.2.5.1.3"><p id="kms_02_0026__en-us_topic_0112992307_p13518194615547">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="49.94%" id="mcps1.3.4.2.2.5.1.4"><p id="kms_02_0026__en-us_topic_0112992307_p18518194625416">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0026__en-us_topic_0112992307_row951818462548"><td class="cellrowborder" valign="top" width="18.04%" headers="mcps1.3.4.2.2.5.1.1 "><p id="kms_02_0026__en-us_topic_0112992307_p1651844612541">key_info</p>
</td>
<td class="cellrowborder" valign="top" width="15.67%" headers="mcps1.3.4.2.2.5.1.2 "><p id="kms_02_0026__en-us_topic_0112992307_p7518184665412">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.35%" headers="mcps1.3.4.2.2.5.1.3 "><p id="kms_02_0026__en-us_topic_0112992307_p165181046115411">Array of objects</p>
</td>
<td class="cellrowborder" valign="top" width="49.94%" headers="mcps1.3.4.2.2.5.1.4 "><p id="kms_02_0026__en-us_topic_0112992307_p85181246135416">Information about keys. For details, see <a href="#kms_02_0026__en-us_topic_0112992307_table4661953591125">Table 4</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><a name="kms_02_0026__en-us_topic_0112992307_table4661953591125"></a><a name="en-us_topic_0112992307_table4661953591125"></a><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0026__en-us_topic_0112992307_table4661953591125" frame="border" border="1" rules="all"><caption><b>Table 4 </b><strong id="kms_02_0026__en-us_topic_0112992307_b045175415911">key_info</strong> field description</caption><thead align="left"><tr id="kms_02_0026__en-us_topic_0112992307_row5741486791125"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.3.2.5.1.1"><p id="kms_02_0026__en-us_topic_0112992307_p2009266891125"><strong id="kms_02_0026__en-us_topic_0112992307_b2071278124">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.4.3.2.5.1.2"><p id="kms_02_0026__en-us_topic_0112992307_p2618658291125"><strong id="kms_02_0026__en-us_topic_0112992307_b84235270619748">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.4.3.2.5.1.3"><p id="kms_02_0026__en-us_topic_0112992307_p1689338191125"><strong id="kms_02_0026__en-us_topic_0112992307_b84235270619745">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.4.3.2.5.1.4"><p id="kms_02_0026__en-us_topic_0112992307_p4073839291125">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0026__en-us_topic_0112992307_row1147544291125"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.3.2.5.1.1 "><p id="kms_02_0026__en-us_topic_0112992307_p708028792054">key_id</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.3.2.5.1.2 "><p id="kms_02_0026__en-us_topic_0112992307_p1443169492054">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.3.2.5.1.3 "><p id="kms_02_0026__en-us_topic_0112992307_p46508422023">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.5.1.4 "><p id="kms_02_0026__en-us_topic_0112992307_p2811658392054">CMK ID</p>
</td>
</tr>
<tr id="kms_02_0026__en-us_topic_0112992307_row5657868491125"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.3.2.5.1.1 "><p id="kms_02_0026__en-us_topic_0112992307_p2878556892054">key_alias</p>
</td>
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.4.3.2.5.1.2 "><p id="kms_02_0026__en-us_topic_0112992307_p1776938992054">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.4.3.2.5.1.3 "><p id="kms_02_0026__en-us_topic_0112992307_p488214441922">String</p>
</td>
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.4.3.2.5.1.4 "><p id="kms_02_0026__en-us_topic_0112992307_p3003444392054">Alias of a CMK</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="kms_02_0026__en-us_topic_0112992307_section32834116430"><h4 class="sectiontitle">Examples</h4><p id="kms_02_0026__en-us_topic_0112992307_p111843554444">The following is an example about how to modify a CMK whose alias ID is <span class="parmvalue" id="kms_02_0026__en-us_topic_0112992307_parmvalue19739413241729"><b>bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e</b></span> and alias is <span class="parmvalue" id="kms_02_0026__en-us_topic_0112992307_parmvalue44103755219859"><b>test</b></span>.</p>
<ul id="kms_02_0026__en-us_topic_0112992307_ul93081134314"><li id="kms_02_0026__en-us_topic_0112992307_li3307181124313">Example request<pre class="screen" id="kms_02_0026__en-us_topic_0112992307_screen0307151134318">{
"key_alias": "test",
"key_id": "bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e"
}</pre>
</li><li id="kms_02_0026__en-us_topic_0112992307_li230810134310">Example response<pre class="screen" id="kms_02_0026__en-us_topic_0112992307_screen12307181114320">{
"key_info": {
"key_id": "bb6a3d22-dc93-47ac-b5bd-88df7ad35f1e",
"key_alias": "test"
}
}</pre>
<p id="kms_02_0026__en-us_topic_0112992307_p14307161134310">or</p>
<pre class="screen" id="kms_02_0026__en-us_topic_0112992307_screen830816117439">{
"error": {
"error_code": "KMS.XXXX",
"error_msg": "XXX"
}
}</pre>
</li></ul>
</div>
<div class="section" id="kms_02_0026__en-us_topic_0112992307_section3454223421"><h4 class="sectiontitle">Status Codes</h4><div class="p" id="kms_02_0026__en-us_topic_0112992307_en-us_topic_0112992294_en-us_topic_0079615001_p17772351"><a href="#kms_02_0026__en-us_topic_0112992307_en-us_topic_0112992294_en-us_topic_0079615001_table20596071">Table 5</a> lists the normal status code returned by the response.
<div class="tablenoborder"><a name="kms_02_0026__en-us_topic_0112992307_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><a name="en-us_topic_0112992307_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0026__en-us_topic_0112992307_en-us_topic_0112992294_en-us_topic_0079615001_table20596071" frame="border" border="1" rules="all"><caption><b>Table 5 </b>Status codes</caption><thead align="left"><tr id="kms_02_0026__en-us_topic_0112992307_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_0026__en-us_topic_0112992307_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_0026__en-us_topic_0112992307_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_0026__en-us_topic_0112992307_en-us_topic_0112992294_p30689603203043">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="kms_02_0026__en-us_topic_0112992307_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_0026__en-us_topic_0112992307_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_0026__en-us_topic_0112992307_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_0026__en-us_topic_0112992307_en-us_topic_0112992294_p1885682315512">Request processed successfully.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<p id="kms_02_0026__en-us_topic_0112992307_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>