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>
12 KiB
Batch Creating or Deleting VPN Resource Tags
Function
This interface is used to add multiple tags to or delete multiple tags from a VPN resource instance at a time.
This API is idempotent.
If there are duplicate keys in the request body when you add tags, an error is reported.
During tag creation, duplicate keys are not allowed. If a key exists in the database, its value will be overwritten.
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.
URI
POST /v2.0/{project_id}/ipsec-site-connections/{resource_id}/tags/action
Request Parameter
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
tags |
List<resource_tag> |
Yes |
Specifies the tag list. A tag list can contain a maximum of 10 keys. |
action |
String |
Yes |
Specifies the operation to perform. The value can be create or delete. |
Description of field resource_tag
Name |
Type |
Mandatory |
Description |
---|---|---|---|
key |
String |
Yes |
Specifies the tag key. The parameter constraints are as follows:
|
value |
String |
(This parameter is mandatory when action is set to create and optional when action is set to delete.) |
Specifies the tag value list. The parameter constraints are as follows:
|
Response Parameter
None
Example
- Example Request
POST /v2.0/{project_id}/ipsec-site-connections/{resource_id}/tags/action
Request Body
{ "action": "create", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key", "value": "value3" } ] }
Or
{ "action": "delete", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key2", "value": "value3" } ] }
Returned Values
For details, see section Common Returned Values.