• Virtual Private Cloud

vpc
  1. Help Center
  2. Virtual Private Cloud
  3. API Reference
  4. APIs
  5. Subnet Tag Management
  6. Creating a Tag for a Subnet

Creating a Tag for a Subnet

Function

This interface is used to create a tag for a subnet. In the URI, project_id indicates the project ID, and subnet_id indicates the target subnet ID.

URI

POST /v2.0/{project_id}/subnets/{subnet_id}/tags

Request Message

Request parameter

Table 1 Request parameter

Parameter

Type

Mandatory

Description

tag

resource_tag

Yes

Specifies the tag.

Example request

POST /v2.0/{project_id}/subnets/{subnet_id}/tags
{
    "tag": {
        "key": "key1",
        "value": "value1"
    }
}

Response Message

Response parameter

None

Example response

None

Status Codes

Normal Response Code

Type

Description

204

No Content

Specifies the normal response code for the POST operation.

Error Codes

For details, see section Subnet Tag Error Codes.