doc-exports/docs/vpn/api-ref/vpn_api_1017.html
Hongwei, King Wang 32c06a10a2 vpn_api
Reviewed-by: Sarda, Priya <prsarda@noreply.gitea.eco.tsi-dev.otc-service.com>
Co-authored-by: Hongwei, King Wang <king.wanghongwei@huawei.com>
Co-committed-by: Hongwei, King Wang <king.wanghongwei@huawei.com>
2024-08-15 14:18:28 +00:00

131 lines
16 KiB
HTML

<a name="EN-US_TOPIC_0000001854169201"></a><a name="EN-US_TOPIC_0000001854169201"></a>
<h1 class="topictitle1">Batch Creating or Deleting VPN Tags</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_section9716105931810"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p18061559151817">This API is used to batch create or delete VPN tags.</p>
<p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p18700134219354">This API is idempotent.</p>
<ul id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_ul1969018351466"><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li176916351611">If there are duplicate keys in the request body when you add tags, an error is reported.</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li116911835960">During tag creation, each key must be unique. If the key already exists, the previous value of the key is overwritten.</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li79895312714">If the tag to be deleted does not exist, the deletion is considered successful by default.</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li65531011972">During tag deletion, the value range of the tag character set is not verified.</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li106911351466">When you delete tags, <strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b125123217516">tags</strong> is mandatory, and <strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b153444556">key</strong> cannot be left blank or be an empty string.</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_section14718205991814"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p10808125961812">POST /v2.0/{project_id}/ipsec-site-connections/{resource_id}/tags/action</p>
<div class="note" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_note183774683812"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p133764616389">In the URI, <strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b9262772001">project_id</strong> indicates the project ID, and <strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b02625717014">resource_id</strong> indicates the ID of the target resource.</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_section972418597185"><h4 class="sectiontitle">Request</h4><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p1833281838"><a href="#EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_table2726185911818">Table 1</a> describes the request parameters.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_table2726185911818"></a><a name="en-us_topic_0000001591616793_en-us_topic_0103470569_table2726185911818"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_table2726185911818" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameters</caption><thead align="left"><tr id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_row1080816597184"><th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.3.3.2.5.1.1"><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p208081359151817">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.82178217821782%" id="mcps1.3.3.3.2.5.1.2"><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p9808135941814">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.653465346534652%" id="mcps1.3.3.3.2.5.1.3"><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p080805991816">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.663366336633665%" id="mcps1.3.3.3.2.5.1.4"><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p680845913189">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_row180885915182"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p148081759191815">tags</p>
</td>
<td class="cellrowborder" valign="top" width="17.82178217821782%" headers="mcps1.3.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p080895941818">List&lt;resource_tag&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="24.653465346534652%" headers="mcps1.3.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p6808115981818">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="43.663366336633665%" headers="mcps1.3.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p141306375718">Specifies the list of tags.</p>
<p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p180814592186">Up to 10 keys are supported.</p>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_row58082596188"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p128082059141814">action</p>
</td>
<td class="cellrowborder" valign="top" width="17.82178217821782%" headers="mcps1.3.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p480816591183">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.653465346534652%" headers="mcps1.3.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p1380825915181">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="43.663366336633665%" headers="mcps1.3.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p1218244219715">Specifies the operation identifier.</p>
<p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p1380812595189">The identifier can be <strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b97801335906">create</strong> or <strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b15781123513013">delete</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_table13242848193719" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Description of field <strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b127899029145237">resource_tag</strong></caption><thead align="left"><tr id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_row13343144812379"><th align="left" class="cellrowborder" valign="top" width="13.86%" id="mcps1.3.3.4.2.5.1.1"><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p15343174853715">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.4%" id="mcps1.3.3.4.2.5.1.2"><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p15643121154020">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.5%" id="mcps1.3.3.4.2.5.1.3"><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p14992939103910">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.24%" id="mcps1.3.3.4.2.5.1.4"><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p11344748183719">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_row103449487379"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p183469482373">key</p>
</td>
<td class="cellrowborder" valign="top" width="18.4%" headers="mcps1.3.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p183268532416">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.5%" headers="mcps1.3.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p1434684863710">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="43.24%" headers="mcps1.3.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p11346184819376">Specifies the tag key.</p>
<p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p6274131875416">The key</p>
<ul id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_ul16111181314542"><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li1187621512541">Must be unique for a resource.</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li611101305416">Cannot be left blank.</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li19111013115413">Can contain a maximum of 36 characters.</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li17111131315545">Can contain only the following character types:<ul id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_ul1811131315418"><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li21181013115419">Uppercase letters</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li711810134542">Lowercase letters</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li16118513105418">Digits</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li15118101315543">Hyphens (-) and underscores (_)</li></ul>
</li></ul>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_row2346548163714"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p1134624816377">value</p>
</td>
<td class="cellrowborder" valign="top" width="18.4%" headers="mcps1.3.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p234619483371">String</p>
<p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p7712135910409"></p>
</td>
<td class="cellrowborder" valign="top" width="24.5%" headers="mcps1.3.3.4.2.5.1.3 "><ul id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_ul1068917281086"><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li14689182815819"><strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b85861649316">value</strong> is mandatory when <strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b113165494645237">action</strong> is set to <strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b58619832245237">create</strong>.</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li136896281818"><strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b71353595110">value</strong> is optional when <strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b11177450145237">action</strong> is set to <strong id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_b186796912545237">delete</strong>.</li></ul>
</td>
<td class="cellrowborder" valign="top" width="43.24%" headers="mcps1.3.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p534634813374">Specifies the list of tag values.</p>
<p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p774211695510">The value</p>
<ul id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_ul2064810351548"><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li1964817352541">Can contain a maximum of 43 characters.</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li1165614352541">Can contain only the following character types:<ul id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_ul6656163575410"><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li1065633514547">Uppercase letters</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li26561535205418">Lowercase letters</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li14656235165414">Digits</li><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li1247616343566">Hyphens (-) and underscores (_)</li></ul>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_section973755901815"><h4 class="sectiontitle">Response</h4><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_p1181015918188">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_section3739159151817"><h4 class="sectiontitle">Example</h4><ul id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_ul93101517511"><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li5310251155120">Example request<pre class="screen" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_en-us_topic_0103470569_screen1581035911812">POST /v2.0/{project_id}/ipsec-site-connections/{resource_id}/tags/action</pre>
<div class="p" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p31874534594">Request body<pre class="screen" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_screen206373985310">{
"action": "create",
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key",
"value": "value3"
}
]
}</pre>
</div>
<p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p105941417532">Or</p>
<pre class="screen" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_screen113071417195310">{
"action": "delete",
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key2",
"value": "value3"
}
]
}</pre>
</li></ul>
</div>
<ul id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_ul51075085215"><li id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li210730155214">Example response<p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p31391471523"><a name="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_li210730155214"></a><a name="en-us_topic_0000001591616793_li210730155214"></a>None</p>
</li></ul>
<div class="section" id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_section14121248103610"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0000001854169201__en-us_topic_0000001591616793_p2590175117365">For details, see <a href="vpn_api_1054.html#EN-US_TOPIC_0000001854089293">Common Returned Values</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="vpn_api_1015.html">Tag Management</a></div>
</div>
</div>