forked from docs/doc-exports
Reviewed-by: Sarda, Priya <prsarda@noreply.gitea.eco.tsi-dev.otc-service.com> Co-authored-by: Qin Ying, Fan <fanqinying@huawei.com> Co-committed-by: Qin Ying, Fan <fanqinying@huawei.com>
156 lines
11 KiB
HTML
156 lines
11 KiB
HTML
<a name="nat_api_0017"></a><a name="nat_api_0017"></a>
|
|
|
|
<h1 class="topictitle1">Adding or Deleting NAT Gateway Tags in Batches</h1>
|
|
<div id="body1527752422370"><div class="section" id="nat_api_0017__section264067181518"><h4 class="sectiontitle">Function</h4><p id="nat_api_0017__p15745178152">This API is used to add or delete tags of a specific NAT gateway in batches.</p>
|
|
<p id="nat_api_0017__p14745579156">TMS uses this API to manage service resource tags.</p>
|
|
<p id="nat_api_0017__p10745371156">You can add a maximum of 20 tags to a NAT gateway.</p>
|
|
<p id="nat_api_0017__p374512710153">This API is idempotent.</p>
|
|
<p id="nat_api_0017__p87457791517">If there are duplicate keys in the request body when you add tags, an error is reported.</p>
|
|
<p id="nat_api_0017__p137451676158">If a to-be-created tag has the same key as an existing tag, the tag will be created and overwrite the existing one.</p>
|
|
<p id="nat_api_0017__p27451376150">When tags are being deleted and some tags do not exist, the operation is considered successful by default. The character set of the tags will not be checked. A key and a value can respectively contain up to 127 and 255 Unicode characters. When you delete tags, the tag structure cannot be missing, and the key cannot be left blank or be an empty string.</p>
|
|
</div>
|
|
<div class="section" id="nat_api_0017__section196426711158"><h4 class="sectiontitle">URI</h4><ul id="nat_api_0017__ul7363122518587"><li id="nat_api_0017__li1536319254583">URI format</li></ul>
|
|
<p id="nat_api_0017__p066755610560">POST /v2.0/{project_id}/nat_gateways/{nat_gateway_id}/tags/action</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0017__table116561074156" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Parameter description</caption><thead align="left"><tr id="nat_api_0017__row13747157151517"><th align="left" class="cellrowborder" valign="top" width="21.8%" id="mcps1.3.2.4.2.5.1.1"><p id="nat_api_0017__p7747073152">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.349999999999998%" id="mcps1.3.2.4.2.5.1.2"><p id="nat_api_0017__p1142294714719">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="19.23%" id="mcps1.3.2.4.2.5.1.3"><p id="nat_api_0017__p12266144434715">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="41.620000000000005%" id="mcps1.3.2.4.2.5.1.4"><p id="nat_api_0017__p1974877131511">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="nat_api_0017__row1874912711158"><td class="cellrowborder" valign="top" width="21.8%" headers="mcps1.3.2.4.2.5.1.1 "><p id="nat_api_0017__p167497771512">project_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.349999999999998%" headers="mcps1.3.2.4.2.5.1.2 "><p id="nat_api_0017__p74221647194711">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.23%" headers="mcps1.3.2.4.2.5.1.3 "><p id="nat_api_0017__p62660448475">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.620000000000005%" headers="mcps1.3.2.4.2.5.1.4 "><p id="nat_api_0017__p1374967171510">Specifies the project ID.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0017__row37491176154"><td class="cellrowborder" valign="top" width="21.8%" headers="mcps1.3.2.4.2.5.1.1 "><p id="nat_api_0017__p14749137171519">nat_gateway_id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.349999999999998%" headers="mcps1.3.2.4.2.5.1.2 "><p id="nat_api_0017__p1542234716473">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.23%" headers="mcps1.3.2.4.2.5.1.3 "><p id="nat_api_0017__p8266204414714">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="41.620000000000005%" headers="mcps1.3.2.4.2.5.1.4 "><p id="nat_api_0017__p37491078154">Specifies the NAT gateway ID.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="nat_api_0017__section10741144319299"><h4 class="sectiontitle">Request</h4><p id="nat_api_0017__p17270314581"><a href="#nat_api_0017__table57458431295">Table 2</a> describes the request parameters.</p>
|
|
|
|
<div class="tablenoborder"><a name="nat_api_0017__table57458431295"></a><a name="table57458431295"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0017__table57458431295" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="nat_api_0017__row139161943202916"><th align="left" class="cellrowborder" valign="top" width="20.919999999999998%" id="mcps1.3.3.3.2.5.1.1"><p id="nat_api_0017__p1391674332919">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.4%" id="mcps1.3.3.3.2.5.1.2"><p id="nat_api_0017__p18830135864715">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="19.28%" id="mcps1.3.3.3.2.5.1.3"><p id="nat_api_0017__p4501955174716">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="42.4%" id="mcps1.3.3.3.2.5.1.4"><p id="nat_api_0017__p18916543122915">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="nat_api_0017__row1591619434299"><td class="cellrowborder" valign="top" width="20.919999999999998%" headers="mcps1.3.3.3.2.5.1.1 "><p id="nat_api_0017__p16916243182920">tags</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.4%" headers="mcps1.3.3.3.2.5.1.2 "><p id="nat_api_0017__p108301858174720">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.28%" headers="mcps1.3.3.3.2.5.1.3 "><p id="nat_api_0017__p9501145514478">Array</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.4%" headers="mcps1.3.3.3.2.5.1.4 "><p id="nat_api_0017__p5917114342918">Specifies tags. For details, see <a href="#nat_api_0017__table9760114311291">Table 3</a>.</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0017__row10917743192919"><td class="cellrowborder" valign="top" width="20.919999999999998%" headers="mcps1.3.3.3.2.5.1.1 "><p id="nat_api_0017__p1091794382911">action</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.4%" headers="mcps1.3.3.3.2.5.1.2 "><p id="nat_api_0017__p683005818475">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.28%" headers="mcps1.3.3.3.2.5.1.3 "><p id="nat_api_0017__p115011855164710">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.4%" headers="mcps1.3.3.3.2.5.1.4 "><p id="nat_api_0017__p1791716435293">Specifies the operation to be performed. The value can be set to <strong id="nat_api_0017__b842352706101829">create</strong> or <strong id="nat_api_0017__b842352706101833">delete</strong> only.</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<div class="tablenoborder"><a name="nat_api_0017__table9760114311291"></a><a name="table9760114311291"></a><table cellpadding="4" cellspacing="0" summary="" id="nat_api_0017__table9760114311291" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Parameter description of field <strong id="nat_api_0017__b84235270695528">tags</strong></caption><thead align="left"><tr id="nat_api_0017__row1491984315297"><th align="left" class="cellrowborder" valign="top" width="21.099999999999998%" id="mcps1.3.3.4.2.5.1.1"><p id="nat_api_0017__p17919154382910">Parameter</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="17.45%" id="mcps1.3.3.4.2.5.1.2"><p id="nat_api_0017__p459802115481">Mandatory</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="18.72%" id="mcps1.3.3.4.2.5.1.3"><p id="nat_api_0017__p11237101711488">Type</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="42.730000000000004%" id="mcps1.3.3.4.2.5.1.4"><p id="nat_api_0017__p1919124332918">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="nat_api_0017__row991994317291"><td class="cellrowborder" valign="top" width="21.099999999999998%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0017__p59201343122914">key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.45%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0017__p2059962194820">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.72%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0017__p9237217194815">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.730000000000004%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0017__p692017431295">Specifies the tag key. It contains a maximum of 36 Unicode characters. This parameter cannot be left blank or contain ASCII (0-31) or the following characters: =*<>\,|/</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="nat_api_0017__row16920943102918"><td class="cellrowborder" valign="top" width="21.099999999999998%" headers="mcps1.3.3.4.2.5.1.1 "><p id="nat_api_0017__p692034313290">value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="17.45%" headers="mcps1.3.3.4.2.5.1.2 "><p id="nat_api_0017__p1059962144812">Yes</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.72%" headers="mcps1.3.3.4.2.5.1.3 "><p id="nat_api_0017__p0237151754813">String</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="42.730000000000004%" headers="mcps1.3.3.4.2.5.1.4 "><p id="nat_api_0017__p199201643132919">Specifies the key value. Each value contains a maximum of 43 Unicode characters. If <strong id="nat_api_0017__b84235270611421">value</strong> is specified, tags are deleted by key and value. If <strong id="nat_api_0017__b842352706114252">value</strong> is not specified, tags are deleted by key. The value can be an empty character string. It cannot contain ASCII (0-31) or the following characters: =*<>\,|/</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="nat_api_0017__section11781194315298"><h4 class="sectiontitle">Response</h4><p id="nat_api_0017__p1592216431292">None</p>
|
|
</div>
|
|
<div class="section" id="nat_api_0017__section17782134382915"><h4 class="sectiontitle">Examples</h4><ul id="nat_api_0017__ul14464052175912"><li id="nat_api_0017__li946416524599">Example request<pre class="screen" id="nat_api_0017__screen18923243192915">POST https://{VPC_endpoint}/v2.0/9ad601814ac94c80bf7bb9073ded66fc/nat_gateways/fe1a4cf0-27fe-4b97-a9b1-2c67c127f0e0/tags/action
|
|
{
|
|
"action": "create",
|
|
"tags": [
|
|
{
|
|
"key": "key1",
|
|
"value": "value1"
|
|
},
|
|
{
|
|
"key": "key2",
|
|
"value": "value2"
|
|
}
|
|
]
|
|
}
|
|
Or
|
|
{
|
|
"action": "delete",
|
|
"tags": [
|
|
{
|
|
"key": "key1",
|
|
"value": "value1
|
|
},
|
|
{
|
|
"key": "key2",
|
|
"value": "value2"
|
|
}
|
|
]
|
|
}</pre>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="nat_api_0017__section197992437294"><h4 class="sectiontitle">Example response</h4><p id="nat_api_0017__p4925114313291">None</p>
|
|
</div>
|
|
<div class="section" id="nat_api_0017__section979984310296"><h4 class="sectiontitle">Status Code</h4><p id="nat_api_0017__p1492584310291">See <a href="nat_api_0038.html">Status Codes</a>.</p>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="nat_api_0015.html">Tags</a></div>
|
|
</div>
|
|
</div>
|
|
|