All Products
Search
Document Center

:TagResources

更新时间:Oct 26, 2023

Adds labels to a specified Container Service for Kubernetes (ACK) cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request syntax

PUT /tags HTTP/1.1
Content-Type:application/json

{
  "resource_ids" : [ "String" ],
  "resource_type" : "String",
  "region_id" : "String",
  "tags" : [ {
    "key" : "String",
    "value" : "String"
  } ]
}

Request parameters

Table 1. Request body parameters

Parameter

Type

Required

Example

Description

resource_ids

Array of String

Yes

[c1a7bb282fc0d48b****]

The IDs of the resources to which you want to add labels. You can specify up to 50 resources.

resource_type

String

Yes

CLUSTER

The type of the resources. Valid value: CLUSTER.

region_id

String

Yes

cn-hangzhou

The ID of the region where the resources are deployed.

tags

Array of tag

Yes

The key-value pairs that you want to add to the resources. You can add up to 20 key-value pairs. Note:

  • A value cannot be empty and can contain up to 128 characters.

  • Neither a key or a value can start with aliyun or acs:.

  • Neither a key or a value can contain http:// or https://.

Response syntax

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "String"
}

Response parameters

Table 2. Response body parameters

Parameter

Type

Example

Description

RequestId

String

2D69A58F-345C-4FDE-88E4-BF51894XXXXX

The request ID.

Examples

Sample requests

PUT /tags HTTP/1.1 
Content-Type:application/json
{
  "resource_ids" : [ "c1a7bb282fc0d48b****" ],
  "resource_type" : "CLUSTER",
  "region_id" : "cn-hangzhou",
  "tags" : [ {
    "key" : "env",
    "value" : "prod"
  } ]
}

Sample success responses

JSON format

HTTP/1.1 200 OK

Error codes

For a list of error codes, visit the API Error Center.