doc-exports/docs/vpn/api-ref/en_topic_0093011485.html
gtema 6b71b4a1fa Initial import of the VPN API document
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: gtema <artem.goncharov@gmail.com>
Co-committed-by: gtema <artem.goncharov@gmail.com>
2022-12-07 13:22:09 +00:00

131 lines
12 KiB
HTML

<a name="en_topic_0093011485"></a><a name="en_topic_0093011485"></a>
<h1 class="topictitle1">Batch Creating or Deleting VPN Resource Tags</h1>
<div id="body1538044062050"><div class="section" id="en_topic_0093011485__en-us_topic_0103470569_section9716105931810"><h4 class="sectiontitle"><strong id="en_topic_0093011485__en-us_topic_0053740021_b842352706112523">Function</strong></h4><p id="en_topic_0093011485__en-us_topic_0103470569_p18061559151817">This interface is used to add multiple tags to or delete multiple tags from a VPN resource instance at a time.</p>
<p id="en_topic_0093011485__p18700134219354">This API is idempotent.</p>
<p id="en_topic_0093011485__p1370074263519">If there are duplicate keys in the request body when you add tags, an error is reported.</p>
<p id="en_topic_0093011485__p1270013424352">During tag creation, duplicate keys are not allowed. If a key exists in the database, its value will be overwritten.</p>
<p id="en_topic_0093011485__p1670044211350">During tag deletion, if some tags do not exist, the operation is considered to be successful by default. The character set of the tags will not be checked. 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="en_topic_0093011485__en-us_topic_0103470569_section14718205991814"><h4 class="sectiontitle">URI</h4><p id="en_topic_0093011485__en-us_topic_0103470569_p10808125961812">POST /v2.0/{project_id}/ipsec-site-connections/{resource_id}/tags/action</p>
<div class="note" id="en_topic_0093011485__note183774683812"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="en_topic_0093011485__p133764616389">In the URI, <strong id="en_topic_0093011485__b84235270692710">project_id</strong> indicates the project ID, and <strong id="en_topic_0093011485__b84235270692722">resource_id</strong> indicates the target resource ID.</p>
</div></div>
</div>
<div class="section" id="en_topic_0093011485__en-us_topic_0103470569_section972418597185"><h4 class="sectiontitle">Request Parameter</h4>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en_topic_0093011485__en-us_topic_0103470569_table2726185911818" frame="border" border="1" rules="all"><thead align="left"><tr id="en_topic_0093011485__en-us_topic_0103470569_row1080816597184"><th align="left" class="cellrowborder" valign="top" width="13.861386138613863%" id="mcps1.3.3.2.1.5.1.1"><p id="en_topic_0093011485__en-us_topic_0103470569_p208081359151817"><strong id="en_topic_0093011485__b842352706172115">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="17.82178217821782%" id="mcps1.3.3.2.1.5.1.2"><p id="en_topic_0093011485__en-us_topic_0103470569_p9808135941814"><strong id="en_topic_0093011485__b84235270610412">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="9.900990099009901%" id="mcps1.3.3.2.1.5.1.3"><p id="en_topic_0093011485__en-us_topic_0103470569_p080805991816"><strong id="en_topic_0093011485__b8423527061798">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="58.415841584158414%" id="mcps1.3.3.2.1.5.1.4"><p id="en_topic_0093011485__en-us_topic_0103470569_p680845913189"><strong id="en_topic_0093011485__b842352706151625">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en_topic_0093011485__en-us_topic_0103470569_row180885915182"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.3.2.1.5.1.1 "><p id="en_topic_0093011485__en-us_topic_0103470569_p148081759191815">tags</p>
</td>
<td class="cellrowborder" valign="top" width="17.82178217821782%" headers="mcps1.3.3.2.1.5.1.2 "><p id="en_topic_0093011485__en-us_topic_0103470569_p080895941818">List&lt;resource_tag&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="9.900990099009901%" headers="mcps1.3.3.2.1.5.1.3 "><p id="en_topic_0093011485__en-us_topic_0103470569_p6808115981818">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="58.415841584158414%" headers="mcps1.3.3.2.1.5.1.4 "><p id="en_topic_0093011485__en-us_topic_0103470569_p180814592186">Specifies the tag list. A tag list can contain a maximum of 10 keys.</p>
</td>
</tr>
<tr id="en_topic_0093011485__en-us_topic_0103470569_row58082596188"><td class="cellrowborder" valign="top" width="13.861386138613863%" headers="mcps1.3.3.2.1.5.1.1 "><p id="en_topic_0093011485__en-us_topic_0103470569_p128082059141814">action</p>
</td>
<td class="cellrowborder" valign="top" width="17.82178217821782%" headers="mcps1.3.3.2.1.5.1.2 "><p id="en_topic_0093011485__en-us_topic_0103470569_p480816591183">String</p>
</td>
<td class="cellrowborder" valign="top" width="9.900990099009901%" headers="mcps1.3.3.2.1.5.1.3 "><p id="en_topic_0093011485__en-us_topic_0103470569_p1380825915181">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="58.415841584158414%" headers="mcps1.3.3.2.1.5.1.4 "><p id="en_topic_0093011485__en-us_topic_0103470569_p1380812595189">Specifies the operation to perform. The value can be <strong id="en_topic_0093011485__b842352706101829">create</strong> or <strong id="en_topic_0093011485__b842352706101833">delete</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
<p id="en_topic_0093011485__p146181934183913">Description of field <strong id="en_topic_0093011485__b1964617420162043">resource_tag</strong></p>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="en_topic_0093011485__table13242848193719" frame="border" border="1" rules="all"><thead align="left"><tr id="en_topic_0093011485__row13343144812379"><th align="left" class="cellrowborder" valign="top" width="13.86%" id="mcps1.3.3.4.1.5.1.1"><p id="en_topic_0093011485__p15343174853715"><strong id="en_topic_0093011485__b84235270617246">Name</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="18.4%" id="mcps1.3.3.4.1.5.1.2"><p id="en_topic_0093011485__p15643121154020"><strong id="en_topic_0093011485__b116604603">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.5%" id="mcps1.3.3.4.1.5.1.3"><p id="en_topic_0093011485__p14992939103910"><strong id="en_topic_0093011485__b1552522188">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="43.24%" id="mcps1.3.3.4.1.5.1.4"><p id="en_topic_0093011485__p11344748183719"><strong id="en_topic_0093011485__b255038601">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="en_topic_0093011485__row103449487379"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.3.4.1.5.1.1 "><p id="en_topic_0093011485__p183469482373">key</p>
</td>
<td class="cellrowborder" valign="top" width="18.4%" headers="mcps1.3.3.4.1.5.1.2 "><p id="en_topic_0093011485__p183268532416">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.5%" headers="mcps1.3.3.4.1.5.1.3 "><p id="en_topic_0093011485__p1434684863710">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="43.24%" headers="mcps1.3.3.4.1.5.1.4 "><p id="en_topic_0093011485__p11346184819376">Specifies the tag key.</p>
<p id="en_topic_0093011485__p6274131875416">The parameter constraints are as follows:</p>
<ul id="en_topic_0093011485__ul16111181314542"><li id="en_topic_0093011485__li1187621512541">Must be unique for a resource.</li><li id="en_topic_0093011485__li611101305416">Cannot be left blank.</li><li id="en_topic_0093011485__li19111013115413">Can contain a maximum of 36 characters.</li><li id="en_topic_0093011485__li17111131315545">Can contain only the following character types:<ul id="en_topic_0093011485__ul1811131315418"><li id="en_topic_0093011485__li21181013115419">Uppercase letters</li><li id="en_topic_0093011485__li711810134542">Lowercase letters</li><li id="en_topic_0093011485__li16118513105418">Digits</li><li id="en_topic_0093011485__li15118101315543">Special characters, including hyphens (-) and underscores (_)</li></ul>
</li></ul>
</td>
</tr>
<tr id="en_topic_0093011485__row2346548163714"><td class="cellrowborder" valign="top" width="13.86%" headers="mcps1.3.3.4.1.5.1.1 "><p id="en_topic_0093011485__p1134624816377">value</p>
</td>
<td class="cellrowborder" valign="top" width="18.4%" headers="mcps1.3.3.4.1.5.1.2 "><p id="en_topic_0093011485__p234619483371">String</p>
<p id="en_topic_0093011485__p7712135910409"></p>
</td>
<td class="cellrowborder" valign="top" width="24.5%" headers="mcps1.3.3.4.1.5.1.3 "><p id="en_topic_0093011485__p1128745714115">(This parameter is mandatory when <strong id="en_topic_0093011485__b842352706143922">action</strong> is set to <strong id="en_topic_0093011485__b842352706143928">create</strong> and optional when <strong id="en_topic_0093011485__b2107046872143949">action</strong> is set to <strong id="en_topic_0093011485__b1548858455143949">delete</strong>.)</p>
</td>
<td class="cellrowborder" valign="top" width="43.24%" headers="mcps1.3.3.4.1.5.1.4 "><p id="en_topic_0093011485__p534634813374">Specifies the tag value list.</p>
<p id="en_topic_0093011485__p774211695510">The parameter constraints are as follows:</p>
<ul id="en_topic_0093011485__ul2064810351548"><li id="en_topic_0093011485__li1964817352541">Can contain a maximum of 43 characters.</li><li id="en_topic_0093011485__li1165614352541">Can contain only the following character types:<ul id="en_topic_0093011485__ul6656163575410"><li id="en_topic_0093011485__li1065633514547">Uppercase letters</li><li id="en_topic_0093011485__li26561535205418">Lowercase letters</li><li id="en_topic_0093011485__li14656235165414">Digits</li><li id="en_topic_0093011485__li186561235145412">Special characters, including hyphens (-) and underscores (_)</li></ul>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="en_topic_0093011485__en-us_topic_0103470569_section973755901815"><h4 class="sectiontitle">Response Parameter</h4><p id="en_topic_0093011485__en-us_topic_0103470569_p1181015918188">None</p>
</div>
<div class="section" id="en_topic_0093011485__en-us_topic_0103470569_section3739159151817"><h4 class="sectiontitle">Example</h4><ul id="en_topic_0093011485__ul93101517511"><li id="en_topic_0093011485__li5310251155120">Example Request<pre class="screen" id="en_topic_0093011485__en-us_topic_0103470569_screen1581035911812">POST /v2.0/{project_id}/ipsec-site-connections/{resource_id}/tags/action</pre>
</li></ul>
</div>
<div class="section" id="en_topic_0093011485__en-us_topic_0103470569_section973915961811"><h4 class="sectiontitle">Request Body</h4><pre class="screen" id="en_topic_0093011485__screen206373985310">{
"action": "create",
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key",
"value": "value3"
}
]
}</pre>
<p id="en_topic_0093011485__p105941417532">Or</p>
<pre class="screen" id="en_topic_0093011485__screen113071417195310">{
"action": "delete",
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key2",
"value": "value3"
}
]
}</pre>
</div>
<ul id="en_topic_0093011485__ul51075085215"><li id="en_topic_0093011485__li210730155214">Example Response<p id="en_topic_0093011485__p31391471523"><a name="en_topic_0093011485__li210730155214"></a><a name="li210730155214"></a>None</p>
</li></ul>
<div class="section" id="en_topic_0093011485__section14121248103610"><h4 class="sectiontitle">Returned Values</h4><p id="en_topic_0093011485__p2590175117365">For details, see section <a href="en_topic_0093011522.html">Common Returned Values</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="en_topic_0093011483.html">Tag Management</a></div>
</div>
</div>