doc-exports/docs/tms/api-ref/en-us_topic_0056765935.html
zhangyue 1bd18f5717 TMS API 2.0.28
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2022-11-08 13:01:58 +00:00

11 KiB

Creating or Deleting Predefined Tags

Function

This API is used to create or delete predefined tags. You can add tags to resources using the predefined tags.

This API supports idempotency and batch processing.

Idempotent operations refer to invoking the same API for multiple times by using the same parameters, which have the same impact on the system.

URI

POST /v1.0/predefine_tags/action

Request

  • Parameter description
    Table 1 Parameters in the request

    Name

    Mandatory

    Type

    Description

    action

    Yes

    String

    Specifies the operation identifier.

    This parameter value is case sensitive and can be create or delete.

    tags

    Yes

    List<predefine_tag_request>

    Specifies the tag list.

    For details, see Table 2.

  • predefine_tag_request field description
    Table 2 Parameter description

    Name

    Mandatory

    Type

    Description

    key

    Yes

    String

    Specifies the key.

    It cannot be left blank and can contain a maximum of 36 Unicode characters. Can contain only digits, letters, hyphens (-), and underscores (_).

    value

    Yes

    String

    Specifies the value.

    Each value contains a maximum of 43 Unicode characters and can be an empty string. Can contain only digits, letters, hyphens (-), and underscores (_).

  • Example request
    POST https://TMS endpoint/v1.0/predefine_tags/action
    {
        "action": "create",
        "tags": [
            {
                "key": "ENV1",
                "value": "DEV1"
            },
            {
                "key": "ENV2",
                "value": "DEV2"
            }
        ]
    }

Response

  • Parameter description

    None

  • Example response

    None

Status Codes

See Status Code.

Error Codes

See Error Code Description.