forked from docs/doc-exports
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>
131 lines
11 KiB
HTML
131 lines
11 KiB
HTML
<a name="kms_02_0043"></a><a name="kms_02_0043"></a>
|
|
|
|
<h1 class="topictitle1">Querying CMK Tags</h1>
|
|
<div id="body1521020894928"><div class="section" id="kms_02_0043__en-us_topic_0112992321_section1176242255117"><h4 class="sectiontitle">Function</h4><p id="kms_02_0043__en-us_topic_0112992321_p1089312575113">This API allows you to query tags of a specified CMK.</p>
|
|
</div>
|
|
<p id="kms_02_0043__en-us_topic_0112992321_p15654134845116">TMS may use this API to query all tags of a specified CMK.</p>
|
|
<div class="section" id="kms_02_0043__en-us_topic_0112992321_section1227165345118"><h4 class="sectiontitle">URI</h4><ul id="kms_02_0043__en-us_topic_0112992321_ul986611545259"><li id="kms_02_0043__en-us_topic_0112992321_li155531757162511">URI format<p id="kms_02_0043__en-us_topic_0112992321_p177116598259"><a name="kms_02_0043__en-us_topic_0112992321_li155531757162511"></a><a name="en-us_topic_0112992321_li155531757162511"></a>GET /v1.0/{project_id}/kms/{key_id}/tags</p>
|
|
</li><li id="kms_02_0043__en-us_topic_0112992321_li486405413252">Parameter description
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0043__en-us_topic_0112992321_table68661454102512" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="kms_02_0043__en-us_topic_0112992321_row386465419250"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.1.2.5.1.1"><p id="kms_02_0043__en-us_topic_0112992321_p2739096916511">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.3.2.2.1.2.5.1.2"><p id="kms_02_0043__en-us_topic_0112992321_p407603016511">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.3.2.2.1.2.5.1.3"><p id="kms_02_0043__en-us_topic_0112992321_p6172299916511">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.3.2.2.1.2.5.1.4"><p id="kms_02_0043__en-us_topic_0112992321_p3350702116511">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="kms_02_0043__en-us_topic_0112992321_row88669548255"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.1.2.5.1.1 "><p id="kms_02_0043__en-us_topic_0112992321_p15864185413256">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.1.2.5.1.2 "><p id="kms_02_0043__en-us_topic_0112992321_p10866105462516">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.1.2.5.1.3 "><p id="kms_02_0043__en-us_topic_0112992321_p182521751910">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.1.2.5.1.4 "><p id="kms_02_0043__en-us_topic_0112992321_p18866154122512">Project ID</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="kms_02_0043__en-us_topic_0112992321_row7866105411259"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.1.2.5.1.1 "><p id="kms_02_0043__en-us_topic_0112992321_p188661354122516">key_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.3.2.2.1.2.5.1.2 "><p id="kms_02_0043__en-us_topic_0112992321_p1386615452516">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.3.2.2.1.2.5.1.3 "><p id="kms_02_0043__en-us_topic_0112992321_p142756516912">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.3.2.2.1.2.5.1.4 "><p id="kms_02_0043__en-us_topic_0112992321_p5866175412520">36-byte ID of a CMK that matches the regular expression <span class="parmvalue" id="kms_02_0043__en-us_topic_0112992321_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_0043__en-us_topic_0112992321_p58662544251">Example: 0d0466b0-e727-4d9c-b35d-f84bb474a37f</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="kms_02_0043__en-us_topic_0112992321_section11363185405213"><h4 class="sectiontitle">Requests</h4><p id="kms_02_0043__en-us_topic_0112992321_p21326445316">None</p>
|
|
</div>
|
|
<div class="section" id="kms_02_0043__en-us_topic_0112992321_section353620935319"><h4 class="sectiontitle">Responses</h4>
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0043__en-us_topic_0112992321_table198991847173016" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Response parameters</caption><thead align="left"><tr id="kms_02_0043__en-us_topic_0112992321_row11899184723019"><th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.5.2.2.5.1.1"><p id="kms_02_0043__en-us_topic_0112992321_p834764110575">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="16%" id="mcps1.3.5.2.2.5.1.2"><p id="kms_02_0043__en-us_topic_0112992321_p3347144155718">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17%" id="mcps1.3.5.2.2.5.1.3"><p id="kms_02_0043__en-us_topic_0112992321_p3347194175717">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50%" id="mcps1.3.5.2.2.5.1.4"><p id="kms_02_0043__en-us_topic_0112992321_p1347194120578">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="kms_02_0043__en-us_topic_0112992321_row78993471306"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.5.2.2.5.1.1 "><p id="kms_02_0043__en-us_topic_0112992321_p789910477301">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.5.2.2.5.1.2 "><p id="kms_02_0043__en-us_topic_0112992321_p19899204713015">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.5.2.2.5.1.3 "><p id="kms_02_0043__en-us_topic_0112992321_p138991147153014">Array of objects</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.2.5.1.4 "><div class="p" id="kms_02_0043__en-us_topic_0112992321_p3215143810421">list of tags, including tag keys and tag values.<ul id="kms_02_0043__en-us_topic_0112992321_ul17835144253711"><li id="kms_02_0043__en-us_topic_0112992321_li883514219377"><strong id="kms_02_0043__en-us_topic_0112992321_b842352706165737">key</strong> indicates the tag key. A CMK can have a maximum of 10 keys, and each of them is unique and cannot be empty. A key cannot have duplicate values. The value of <strong id="kms_02_0043__en-us_topic_0112992321_b842352706165433">key</strong> contains a maximum of 36 characters.</li><li id="kms_02_0043__en-us_topic_0112992321_li6835144219377"><strong id="kms_02_0043__en-us_topic_0112992321_b842352706165447">value</strong> indicates the tag value. Each tag value can contain a maximum of 43 characters. The relationship between values is <strong id="kms_02_0043__en-us_topic_0112992321_b842352706165526">AND</strong>.</li></ul>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="kms_02_0043__en-us_topic_0112992321_row3937146994858"><td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.5.2.2.5.1.1 "><p id="kms_02_0043__en-us_topic_0112992321_p3497239294858">existTagNum</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="16%" headers="mcps1.3.5.2.2.5.1.2 "><p id="kms_02_0043__en-us_topic_0112992321_p866149694858">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17%" headers="mcps1.3.5.2.2.5.1.3 "><p id="kms_02_0043__en-us_topic_0112992321_p1419150894858">Integer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50%" headers="mcps1.3.5.2.2.5.1.4 "><p id="kms_02_0043__en-us_topic_0112992321_p3049260594858">Number of key tags.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="kms_02_0043__en-us_topic_0112992321_section13892161018553"><h4 class="sectiontitle">Examples</h4><p id="kms_02_0043__en-us_topic_0112992321_p1783013125511">The following example describes how to query CMK tags.</p>
|
|
<ul id="kms_02_0043__en-us_topic_0112992321_ul529544375618"><li id="kms_02_0043__en-us_topic_0112992321_li4293174335614">Example request<p id="kms_02_0043__en-us_topic_0112992321_p199961749105617"><a name="kms_02_0043__en-us_topic_0112992321_li4293174335614"></a><a name="en-us_topic_0112992321_li4293174335614"></a>None</p>
|
|
</li><li id="kms_02_0043__en-us_topic_0112992321_li1029319438569">Example response<pre class="screen" id="kms_02_0043__en-us_topic_0112992321_screen1229574345614">{ "tags": [
|
|
{
|
|
"key": "key1",
|
|
"value": "value1"
|
|
},
|
|
{
|
|
"key": "key2",
|
|
"value": "value3"
|
|
}
|
|
],
|
|
"existTagsNum":2
|
|
}</pre>
|
|
<div class="p" id="kms_02_0043__en-us_topic_0112992321_p2830104610564">or<pre class="screen" id="kms_02_0043__en-us_topic_0112992321_screen22951543185616">{
|
|
"error": {
|
|
"error_code": "KMS.XXXX",
|
|
"error_msg": "XXX"
|
|
}
|
|
}</pre>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="kms_02_0043__en-us_topic_0112992321_section192111133389"><h4 class="sectiontitle">Status Codes</h4><div class="p" id="kms_02_0043__en-us_topic_0112992321_en-us_topic_0112992294_en-us_topic_0079615001_p17772351"><a href="#kms_02_0043__en-us_topic_0112992321_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_0043__en-us_topic_0112992321_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><a name="en-us_topic_0112992321_en-us_topic_0112992294_en-us_topic_0079615001_table20596071"></a><table cellpadding="4" cellspacing="0" summary="" id="kms_02_0043__en-us_topic_0112992321_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_0043__en-us_topic_0112992321_en-us_topic_0112992294_en-us_topic_0079615001_row9746163"><th align="left" class="cellrowborder" valign="top" width="16.16%" id="mcps1.3.7.2.2.2.4.1.1"><p id="kms_02_0043__en-us_topic_0112992321_en-us_topic_0112992294_p57545694203043">Status Code</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="28.28%" id="mcps1.3.7.2.2.2.4.1.2"><p id="kms_02_0043__en-us_topic_0112992321_en-us_topic_0112992294_p4531342288">Status</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="55.559999999999995%" id="mcps1.3.7.2.2.2.4.1.3"><p id="kms_02_0043__en-us_topic_0112992321_en-us_topic_0112992294_p30689603203043">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="kms_02_0043__en-us_topic_0112992321_en-us_topic_0112992294_en-us_topic_0079615001_row48621261"><td class="cellrowborder" valign="top" width="16.16%" headers="mcps1.3.7.2.2.2.4.1.1 "><p id="kms_02_0043__en-us_topic_0112992321_en-us_topic_0112992294_en-us_topic_0079615001_p46008046">200</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="28.28%" headers="mcps1.3.7.2.2.2.4.1.2 "><p id="kms_02_0043__en-us_topic_0112992321_en-us_topic_0112992294_p7538425819">OK</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.559999999999995%" headers="mcps1.3.7.2.2.2.4.1.3 "><p id="kms_02_0043__en-us_topic_0112992321_en-us_topic_0112992294_p1885682315512">Request processed successfully.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<p id="kms_02_0043__en-us_topic_0112992321_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>
|
|
|