doc-exports/docs/vpn/api-ref/vpn_api_1018.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

94 lines
11 KiB
HTML

<a name="EN-US_TOPIC_0000001854089249"></a><a name="EN-US_TOPIC_0000001854089249"></a>
<h1 class="topictitle1">Creating Tags for a VPN</h1>
<div id="body8662426"><div class="section" id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_section6739112719406"><h4 class="sectiontitle">Function</h4><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_p2855327124013">This API is used to create tags for a VPN.</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_section197391227124012"><h4 class="sectiontitle">URI</h4><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p920724185313">POST /v2.0/{project_id}/ipsec-site-connections/{resource_id}/tags</p>
<div class="note" id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_note18712078394"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p17122718399">In the URI, <strong id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_b84235270692710">project_id</strong> indicates the project ID, and <strong id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_b84235270692722">resource_id</strong> indicates the ID of the target resource.</p>
</div></div>
</div>
<div class="section" id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_section074912764017"><h4 class="sectiontitle">Request</h4><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p145653342396"><a href="#EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_table14751112719406">Table 1</a> describes the request parameter.</p>
<div class="tablenoborder"><a name="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_table14751112719406"></a><a name="en-us_topic_0000001591841849_en-us_topic_0103470566_table14751112719406"></a><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_table14751112719406" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request parameter</caption><thead align="left"><tr id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_row1085714277402"><th align="left" class="cellrowborder" valign="top" width="14.000000000000002%" id="mcps1.3.3.3.2.5.1.1"><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_p48571827164012">Parameter</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24%" id="mcps1.3.3.3.2.5.1.2"><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_p685711273400">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.79%" id="mcps1.3.3.3.2.5.1.3"><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_p118573278400">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="37.21%" id="mcps1.3.3.3.2.5.1.4"><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_p198576274405">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_row1985711272400"><td class="cellrowborder" valign="top" width="14.000000000000002%" headers="mcps1.3.3.3.2.5.1.1 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_p9857152794012">tag</p>
</td>
<td class="cellrowborder" valign="top" width="24%" headers="mcps1.3.3.3.2.5.1.2 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_p6857172715402">List&lt;resource_tag&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="24.79%" headers="mcps1.3.3.3.2.5.1.3 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_p198573277400">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="37.21%" headers="mcps1.3.3.3.2.5.1.4 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_p188571327104019">Specifies the tag.</p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_table13242848193719" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Description of field <strong id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_b064533411108">resource_tag</strong></caption><thead align="left"><tr id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_row13343144812379"><th align="left" class="cellrowborder" valign="top" width="14.649999999999999%" id="mcps1.3.3.4.2.5.1.1"><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p15343174853715">Name</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="23.369999999999997%" id="mcps1.3.3.4.2.5.1.2"><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p15643121154020">Type</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="24.990000000000002%" id="mcps1.3.3.4.2.5.1.3"><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p13431648163716">Mandatory</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="36.99%" id="mcps1.3.3.4.2.5.1.4"><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p11344748183719">Description</p>
</th>
</tr>
</thead>
<tbody><tr id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_row103449487379"><td class="cellrowborder" valign="top" width="14.649999999999999%" headers="mcps1.3.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p183469482373">key</p>
</td>
<td class="cellrowborder" valign="top" width="23.369999999999997%" headers="mcps1.3.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p5569213105916">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.990000000000002%" headers="mcps1.3.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p1434684863710">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="36.99%" headers="mcps1.3.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p11346184819376">Specifies the tag key.</p>
<p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p154442255810">The key</p>
<ul id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_ul17240515195820"><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li2216121845812">Must be unique for a resource.</li><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li2240915185819">Cannot be left blank.</li><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li224051511589">Can contain a maximum of 36 characters.</li><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li1624010151587">Can contain only the following character types:<ul id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_ul19240161517582"><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li192401515145815">Uppercase letters</li><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li5240191510588">Lowercase letters</li><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li42406158583">Digits</li><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li15118101315543">Hyphens (-) and underscores (_)</li></ul>
</li></ul>
</td>
</tr>
<tr id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_row2346548163714"><td class="cellrowborder" valign="top" width="14.649999999999999%" headers="mcps1.3.3.4.2.5.1.1 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p1134624816377">value</p>
</td>
<td class="cellrowborder" valign="top" width="23.369999999999997%" headers="mcps1.3.3.4.2.5.1.2 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p183571615913">String</p>
</td>
<td class="cellrowborder" valign="top" width="24.990000000000002%" headers="mcps1.3.3.4.2.5.1.3 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p234619483371">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="36.99%" headers="mcps1.3.3.4.2.5.1.4 "><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p534634813374">Specifies the tag value.</p>
<p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p193981434195813">The value</p>
<ul id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_ul186515095815"><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li28651750195812">Can contain a maximum of 43 characters.</li><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li9865195020584">Can contain only the following character types:<ul id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_ul1086516509585"><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li3865145016582">Uppercase letters</li><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li38731509588">Lowercase letters</li><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li3873165015811">Digits</li><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li1037064485614">Hyphens (-) and underscores (_)</li></ul>
</li></ul>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_section775782711402"><h4 class="sectiontitle">Response</h4><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_p18577274409">None</p>
</div>
<div class="section" id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_en-us_topic_0103470566_section775882720405"><h4 class="sectiontitle">Example</h4><ul id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_ul10660174104115"><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li46601742419">Example request<pre class="screen" id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_screen59991914116">POST /v2.0/{project_id}/ipsec-site-connections/{resource_id}/tags
{
"tag": {
"key": "key1",
"value": "value1"
}
}</pre>
</li><li id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li1267016108110">Example response<p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_p17140516012"><a name="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_li1267016108110"></a><a name="en-us_topic_0000001591841849_li1267016108110"></a>None</p>
</li></ul>
</div>
<div class="section" id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_section14121248103610"><h4 class="sectiontitle">Returned Values</h4><p id="EN-US_TOPIC_0000001854089249__en-us_topic_0000001591841849_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>