Updated on 2024-10-31 GMT+08:00

Adding Tags to a Network ACL in Batches

Function

This API is used to add tags to a specified network ACL in batches. This is an idempotent API. When you add tags, if there are duplicate keys in the request body, an error is reported. Duplicate keys are not allowed. If a key already exists, its value will be overwritten by the new value.

Debugging

You can debug this API through automatic authentication in API Explorer.

URI

POST /v3/{project_id}/firewalls/{firewall_id}/tags/create

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

firewall_id

Yes

String

The unique ID of a network ACL.

The value is a string in UUID format.

The network ACL with a given ID must exist.

project_id

Yes

String

Project ID

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

tags

Yes

Array of ResourceTag objects

Tags

Table 3 ResourceTag

Parameter

Mandatory

Type

Description

key

Yes

String

  • Tag key

  • Tag keys must be unique for each resource.

Minimum: 1

Maximum: 128

value

Yes

String

  • Tag value.

Maximum: 255

Response Parameters

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

request_id

String

Request ID.

error_msg

String

Error message.

error_code

String

Error code.

Status code: 401

Table 5 Response body parameters

Parameter

Type

Description

request_id

String

Request ID.

error_msg

String

Error message.

error_code

String

Error code.

Status code: 403

Table 6 Response body parameters

Parameter

Type

Description

request_id

String

Request ID.

error_msg

String

Error message.

error_code

String

Error code.

Status code: 404

Table 7 Response body parameters

Parameter

Type

Description

request_id

String

Request ID.

error_msg

String

Error message.

error_code

String

Error code.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

request_id

String

Request ID.

error_msg

String

Error message.

error_code

String

Error code.

Example Requests

Add two tags to a network ACL. For one tag, the key is keyxxx and the value is value1. The key of the other tag is keyyyy, and the value is value2.

POST https://{Endpoint}/v3/{project_id}/firewalls/{firewall_id}/tags/create

{
  "tags" : [ {
    "key" : "keyxxx",
    "value" : "value1"
  }, {
    "key" : "keyyyy",
    "value" : "value2"
  } ]
}

Example Responses

None

Status Codes

Status Code

Description

204

Normal request response

400

Invalid parameter

401

Authentication failure

403

Insufficient permissions

404

Not found

500

System exception

Error Codes

See Error Codes.