doc-exports/docs/vpcep/api-ref/vpcep_06_0502.html
Qin Ying, Fan ef5d2cd3cf VPCEP API 20230307 version
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>
2023-06-14 11:56:35 +00:00

160 lines
12 KiB
HTML

<a name="vpcep_06_0502"></a><a name="vpcep_06_0502"></a>
<h1 class="topictitle1">Batch Adding Tags to or Deleting Tags from a Specified Resource</h1>
<div id="body1568971488962"><div class="section" id="vpcep_06_0502__section661424813316"><h4 class="sectiontitle">Function</h4><p id="vpcep_06_0502__p1916514914317">This API is used to batch add tags to or delete tags from a specified VPC endpoint service or VPC endpoint.</p>
<ul id="vpcep_06_0502__ul183202379359"><li id="vpcep_06_0502__li19321337193518">You can add up to 20 tags to a resource.</li></ul>
</div>
<div class="section" id="vpcep_06_0502__section2061734818319"><h4 class="sectiontitle">URI</h4><p id="vpcep_06_0502__p81653491633">POST /v1/{project_id}/{resource_type}/{resource_id}/tags/action</p>
<p id="vpcep_06_0502__p3693143463716"><a href="#vpcep_06_0502__table366094812311">Table 1</a> describes parameters in this URI.</p>
<div class="tablenoborder"><a name="vpcep_06_0502__table366094812311"></a><a name="table366094812311"></a><table cellpadding="4" cellspacing="0" summary="" id="vpcep_06_0502__table366094812311" frame="border" border="1" rules="all"><caption><b>Table 1 </b>URI parameters</caption><thead align="left"><tr id="vpcep_06_0502__row41660491739"><th align="left" class="cellrowborder" valign="top" width="25.509999999999998%" id="mcps1.3.2.4.2.5.1.1"><p id="vpcep_06_0502__p1416684915316"><strong id="vpcep_06_0502__b13237153019273">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.43%" id="mcps1.3.2.4.2.5.1.2"><p id="vpcep_06_0502__p19166154917315"><strong id="vpcep_06_0502__b8472203112718">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="16.33%" id="mcps1.3.2.4.2.5.1.3"><p id="vpcep_06_0502__p4166249836"><strong id="vpcep_06_0502__b1352393210278">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="36.730000000000004%" id="mcps1.3.2.4.2.5.1.4"><p id="vpcep_06_0502__p141665498310"><strong id="vpcep_06_0502__b14648123312270">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpcep_06_0502__row2166154910312"><td class="cellrowborder" valign="top" width="25.509999999999998%" headers="mcps1.3.2.4.2.5.1.1 "><p id="vpcep_06_0502__p11166114916316">project_id</p>
</td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.2.4.2.5.1.2 "><p id="vpcep_06_0502__p216644910311">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.33%" headers="mcps1.3.2.4.2.5.1.3 "><p id="vpcep_06_0502__p1216614491532">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.730000000000004%" headers="mcps1.3.2.4.2.5.1.4 "><p id="vpcep_06_0502__p916613492318">Specifies the project ID. For details about how to obtain the project ID, see <a href="vpcep_08_0003.html">Obtaining a Project ID</a>.</p>
</td>
</tr>
<tr id="vpcep_06_0502__row916610491316"><td class="cellrowborder" valign="top" width="25.509999999999998%" headers="mcps1.3.2.4.2.5.1.1 "><p id="vpcep_06_0502__p131662491537">resource_type</p>
</td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.2.4.2.5.1.2 "><p id="vpcep_06_0502__p91665491736">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.33%" headers="mcps1.3.2.4.2.5.1.3 "><p id="vpcep_06_0502__p31660491332">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.730000000000004%" headers="mcps1.3.2.4.2.5.1.4 "><p id="vpcep_06_0502__p201661649630">Specifies the resource type, which can be <strong id="vpcep_06_0502__b202455817411">endpoint_service</strong> or <strong id="vpcep_06_0502__b5249581417">endpoint</strong>.</p>
</td>
</tr>
<tr id="vpcep_06_0502__row016610491139"><td class="cellrowborder" valign="top" width="25.509999999999998%" headers="mcps1.3.2.4.2.5.1.1 "><p id="vpcep_06_0502__p216613491315">resource_id</p>
</td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.2.4.2.5.1.2 "><p id="vpcep_06_0502__p181669491533">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="16.33%" headers="mcps1.3.2.4.2.5.1.3 "><p id="vpcep_06_0502__p1216714490315">String</p>
</td>
<td class="cellrowborder" valign="top" width="36.730000000000004%" headers="mcps1.3.2.4.2.5.1.4 "><p id="vpcep_06_0502__p1616764911314">Specifies the resource ID, which can be <strong id="vpcep_06_0502__b1571013457276">Endpoint Service ID</strong> or <strong id="vpcep_06_0502__b671104552715">Endpoint ID</strong>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="section" id="vpcep_06_0502__section1469314482038"><h4 class="sectiontitle">Request</h4><ul id="vpcep_06_0502__ul3167749238"><li id="vpcep_06_0502__li1398816161399">Parameter description
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpcep_06_0502__table472134815318" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Request parameters</caption><thead align="left"><tr id="vpcep_06_0502__row2016711493316"><th align="left" class="cellrowborder" valign="top" width="24.490000000000002%" id="mcps1.3.3.2.1.1.2.5.1.1"><p id="vpcep_06_0502__p01671049132"><strong id="vpcep_06_0502__b2892888289">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.43%" id="mcps1.3.3.2.1.1.2.5.1.2"><p id="vpcep_06_0502__p116711494315"><strong id="vpcep_06_0502__b563720132288">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="25.509999999999998%" id="mcps1.3.3.2.1.1.2.5.1.3"><p id="vpcep_06_0502__p16167549535"><strong id="vpcep_06_0502__b12611101611289">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="28.57%" id="mcps1.3.3.2.1.1.2.5.1.4"><p id="vpcep_06_0502__p101673495311"><strong id="vpcep_06_0502__b15620181762817">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpcep_06_0502__row216713494314"><td class="cellrowborder" valign="top" width="24.490000000000002%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="vpcep_06_0502__p016718491237">tags</p>
</td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="vpcep_06_0502__p216713495317">No</p>
</td>
<td class="cellrowborder" valign="top" width="25.509999999999998%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="vpcep_06_0502__p19167249330">List&lt;resource_tag&gt;</p>
</td>
<td class="cellrowborder" valign="top" width="28.57%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="vpcep_06_0502__p7167149832">Lists the tags.</p>
<p id="vpcep_06_0502__p131674497310">This parameter is mandatory for common tenants.</p>
</td>
</tr>
<tr id="vpcep_06_0502__row7167194920310"><td class="cellrowborder" valign="top" width="24.490000000000002%" headers="mcps1.3.3.2.1.1.2.5.1.1 "><p id="vpcep_06_0502__p1416718491037">action</p>
</td>
<td class="cellrowborder" valign="top" width="21.43%" headers="mcps1.3.3.2.1.1.2.5.1.2 "><p id="vpcep_06_0502__p161679491431">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="25.509999999999998%" headers="mcps1.3.3.2.1.1.2.5.1.3 "><p id="vpcep_06_0502__p41675493312">String</p>
</td>
<td class="cellrowborder" valign="top" width="28.57%" headers="mcps1.3.3.2.1.1.2.5.1.4 "><p id="vpcep_06_0502__p1316794911313">Specifies the operation to be performed, which can be <strong id="vpcep_06_0502__b842352706101829">create</strong> or <strong id="vpcep_06_0502__b842352706101833">delete</strong></p>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="vpcep_06_0502__table97481481333" frame="border" border="1" rules="all"><caption><b>Table 3 </b>Data structure of field <strong id="vpcep_06_0502__b12763591506">resource_tag</strong></caption><thead align="left"><tr id="vpcep_06_0502__row2016764915312"><th align="left" class="cellrowborder" valign="top" width="24.48755124487551%" id="mcps1.3.3.2.1.2.2.5.1.1"><p id="vpcep_06_0502__p111679491337"><strong id="vpcep_06_0502__b77177216513">Parameter</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="21.42785721427857%" id="mcps1.3.3.2.1.2.2.5.1.2"><p id="vpcep_06_0502__p616713496313"><strong id="vpcep_06_0502__b2676234511">Mandatory</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="14.288571142885711%" id="mcps1.3.3.2.1.2.2.5.1.3"><p id="vpcep_06_0502__p3167649832"><strong id="vpcep_06_0502__b176641445111">Type</strong></p>
</th>
<th align="left" class="cellrowborder" valign="top" width="39.796020397960206%" id="mcps1.3.3.2.1.2.2.5.1.4"><p id="vpcep_06_0502__p51670493314"><strong id="vpcep_06_0502__b3619105185113">Description</strong></p>
</th>
</tr>
</thead>
<tbody><tr id="vpcep_06_0502__row18167134912310"><td class="cellrowborder" valign="top" width="24.48755124487551%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="vpcep_06_0502__p1167749537">key</p>
</td>
<td class="cellrowborder" valign="top" width="21.42785721427857%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="vpcep_06_0502__p716713491233">Yes</p>
</td>
<td class="cellrowborder" valign="top" width="14.288571142885711%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="vpcep_06_0502__p9167204919312">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="vpcep_06_0502__p131679498315">Specifies the tag key. A tag key contains a maximum of 36 Unicode characters.</p>
<p id="vpcep_06_0502__p9167184912313">The key meets the requirements in <a href="vpcep_06_0504.html">Tag Character Set Specifications</a>.</p>
</td>
</tr>
<tr id="vpcep_06_0502__row1116713491835"><td class="cellrowborder" valign="top" width="24.48755124487551%" headers="mcps1.3.3.2.1.2.2.5.1.1 "><p id="vpcep_06_0502__p91671749238">value</p>
</td>
<td class="cellrowborder" valign="top" width="21.42785721427857%" headers="mcps1.3.3.2.1.2.2.5.1.2 "><p id="vpcep_06_0502__p31671249235">This parameter is mandatory when <strong id="vpcep_06_0502__b842352706143922">action</strong> is set to <strong id="vpcep_06_0502__b842352706143928">create</strong> and optional when <strong id="vpcep_06_0502__b2107046872143949">action</strong> is set to <strong id="vpcep_06_0502__b1548858455143949">delete</strong>.)</p>
</td>
<td class="cellrowborder" valign="top" width="14.288571142885711%" headers="mcps1.3.3.2.1.2.2.5.1.3 "><p id="vpcep_06_0502__p81670495315">String</p>
</td>
<td class="cellrowborder" valign="top" width="39.796020397960206%" headers="mcps1.3.3.2.1.2.2.5.1.4 "><p id="vpcep_06_0502__p11681491312">Specifies the tag value. Each value contains a maximum of 43 Unicode characters. If <strong id="vpcep_06_0502__b633516399164">value</strong> is specified, tags are deleted by key and value. If <strong id="vpcep_06_0502__b23498393160">value</strong> is not specified, tags are deleted by key.</p>
<p id="vpcep_06_0502__p191682049733">The value meets the requirements in <a href="vpcep_06_0504.html">Tag Character Set Specifications</a>.</p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li id="vpcep_06_0502__li9168649839"><a name="vpcep_06_0502__li9168649839"></a><a name="li9168649839"></a>Example request<p id="vpcep_06_0502__p20224107144617"><a name="vpcep_06_0502__li9168649839"></a><a name="li9168649839"></a>POST https://{endpoint}/v1/{project_id}/endpoint_service/{resource_id}/tags/action</p>
<p id="vpcep_06_0502__p145161634104414">or https://{endpoint}/v1/{project_id}/endpoint/{resource_id}/tags/action</p>
<div class="p" id="vpcep_06_0502__p13722174844416">POST /v1/{project_id}/{resource_type}/{resource_id}/tags/action <pre class="screen" id="vpcep_06_0502__screen1816844910315">{
"action": "create",
"tags": [
{
"key": "key1",
"value": "value1"
},
{
"key": "key",
"value": "value3"
}
]
}</pre>
</div>
<div class="p" id="vpcep_06_0502__p194212014456">or<pre class="screen" id="vpcep_06_0502__screen13731843144510">{
"action": "delete",
"tags": [
{
"key": "key1"
},
{
"key": "key2",
"value": "value3"
}
]
}</pre>
</div>
</li></ul>
</div>
<div class="section" id="vpcep_06_0502__section108825481834"><h4 class="sectiontitle">Response</h4><p id="vpcep_06_0502__p717154918320">None</p>
</div>
<div class="section" id="vpcep_06_0502__section158868481831"><h4 class="sectiontitle">Status Codes</h4><p id="vpcep_06_0502__p817113494320">See <a href="vpcep_08_0001.html">Status Codes</a>.</p>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="vpcep_06_0500.html">Tag Function</a></div>
</div>
</div>