• MapReduce Service

mrs
  1. Help Center
  2. MapReduce Service
  3. API Reference
  4. APIs
  5. Tag Management APIs
  6. Adding a Tag to a Specified Cluster

Adding a Tag to a Specified Cluster

Function

This API is used to add a tag to a specified cluster.

A cluster has a maximum of 10 tags. This API is idempotent. If a tag to be created has the same key as an existing tag, the tag will overwrite the existing one.

URI

  • Format

    POST /v1.1/{project_id}/clusters/{cluster_id}/tags

  • Parameter description
    Table 1 URI parameter description

    Parameter

    Mandatory or Not

    Description

    project_id

    Yes

    Project ID. For details on how to obtain the project ID, see Obtaining a Project ID.

    cluster_id

    Yes

    Cluster ID

Request

  • Example:
    { 
        "tag": 
            { 
                "key":"DEV", 
                "value":"DEV1" 
            } 
    } 
  • Parameter description
    Table 2 Request parameter description

    Parameter

    Mandatory or Not

    Type

    Description

    tag

    Yes

    Object

    Tag. For details about parameter description, see Table 3.

    Table 3 tag field description

    Parameter

    Mandatory or Not

    Type

    Description

    key

    Yes

    String

    Tag key. A tag key can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_).

    value

    Yes

    String

    Tag value. A tag value can contain only uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_).

Response

  • Example

    None

  • Parameter description

    None

Status Code

Table 4 describes the status code of this API.

Table 4 Status code

Status Code

Description

204

No Content