Querying Tags

Function

This API is used to query tags of a specific type of resource in a project.

URI

GET /autoscaling-api/v1/{project_id}/{resource_type}/tags

Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

resource_type

Yes

String

Specifies the resource type. The option is as follows:

scaling_group_tag: indicates that the resource type is AS groups.

Request

None

Example Request

This example queries tags of AS groups in a project.

GET https://{Endpoint}/autoscaling-api/v1/{project_id}/scaling_group_tag/tags

Response

Table 2 Response parameters

Parameter

Type

Description

tags

Array of tags objects

Specifies the tags.

Table 3 tags field description

Parameter

Type

Description

key

String

Specifies the tag key.

values

Array of strings

Specifies the tag values.

Example Response

 {
    "tags": [
        {
            "key": "ENV15",
            "values": [
                "ENV15"
            ]
        },
        {
            "key": "111",
            "values": [
                ""
            ]
        },
        {
            "key": "environment",
            "values": [
                "DEV"
            ]
        },
        {
            "key": "ENV151",
            "values": [
                "ENV151"
            ]
        },
        {
            "key": "ENV152",
            "values": [
                "ENV152"
            ]
        }
     ]
 }

Returned Values

Error Codes

See Error Codes.