Updated on 2025-11-21 GMT+08:00

Saving a Resource Tag

Function

This API is used to save a resource tag.

URI

PUT /v2/{project_id}/cfw-cfw/{fw_instance_id}/tags/save

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

fw_instance_id

Yes

String

Firewall ID, which can be obtained by referring to Obtaining a Firewall ID.

project_id

Yes

String

Project ID, which can be obtained by calling an API or from the console. You can obtain it by referring to Obtaining a Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

enterprise_project_id

No

String

Enterprise project ID, which is the ID of a project planned based on organizations. If the enterprise project function is not enabled, the value is 0.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Table 4 Request body parameters

Parameter

Mandatory

Type

Description

tags

No

Array of CreateTag objects

Definition

Create a firewall tag list.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 5 CreateTag

Parameter

Mandatory

Type

Description

key

No

String

Definition

Tag key.

Constraints

N/A

Range

N/A

Default Value

N/A

value

No

String

Definition

Tag value.

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

data

String

  

Status code: 201

Created

Example Requests

Save the firewall resource tag of the project whose ID is 408972e72dcd4c1a9b033e955802a36b. The firewall ID is e743cfaf-8164-4807-aa13-d893d83313cf, and the enterprise project ID is fb55459c-41b3-47fc-885d-540946fddda4. The request body contains two tags: key:test, value:1 and key:tag-1, value:1.

https://{Endpoint}/v2/408972e72dcd4c1a9b033e955802a36b/cfw-cfw/e743cfaf-8164-4807-aa13-d893d83313cf/tags/save?fw_instance_id=e743cfaf-8164-4807-aa13-d893d83313cf&enterprise_project_id=fb55459c-41b3-47fc-885d-540946fddda4

{
  "tags" : [ {
    "key" : "test",
    "value" : "1"
  }, {
    "key" : "tag_zjw-1",
    "value" : "1"
  } ]
}

Example Responses

Status code: 200

OK

{ }

Status Codes

Status Code

Description

200

OK

201

Created

401

Unauthorized: Request error.

403

Forbidden: Access forbidden.

404

Not Found: Web page not found.

Error Codes

See Error Codes.