ListTagResources

更新时间:
复制 MD 格式

Call the ListTagResources API to list the tags associated with your applications.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

sae:ListTagResources

get

*All Resource

*

None None

Request syntax

GET /tags HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID.

cn-beijing

ResourceType

string

Yes

The resource type. Only application is supported.

application

NextToken

string

No

A query can return a maximum of 50 results. If the number of results exceeds this limit, the response includes a NextToken. To retrieve the next page of results, pass this token in your next request.

A2RN

ResourceIds

string

No

The resource IDs, specified as a JSON array of strings. This parameter is required if the Tags parameter is not specified.

["d42921c4-5433-4abd-8075-0e536f8b****"]

Tags

string

No

The tags used to filter resources. This parameter is required if the ResourceIds parameter is not specified. A tag is a key-value pair.

  • key: The tag key. The key can be 1 to 128 characters in length.

  • value: The tag value. The value can be 1 to 128 characters in length.

Tag keys and tag values are case-sensitive. If you specify multiple tags, the operation returns only resources that have all the specified tags.

A tag key cannot start with aliyun or acs: and cannot contain http:// or https://.

[{"key":"k1","value":"v1"}]

Response elements

Element

Type

Description

Example

object

The data returned.

RequestId

string

The request ID.

7414187F-4F59-4585-9BCF-5F0804E4****

Message

string

The message returned for the request.

  • If the request is successful, success is returned.

  • If the request fails, an error message is returned.

success

TraceId

string

The trace ID that is used to query the details of a request.

0bc5f84e15916043198032146d****

Data

object

The data returned.

NextToken

string

The token that is used to retrieve the next page of results. A query returns a maximum of 50 results. If the results are truncated, you can use this token in a subsequent request to retrieve the next page of results.

""

TagResources

array<object>

The list of tags and their associated resources.

object

The details of a tag and the resource to which the tag is added.

ResourceType

string

The type of the resource. The value is fixed as application.

ALIYUN::SAE::APPLICATION

TagValue

string

The value of the tag.

v1

ResourceId

string

The ID of the application.

d42921c4-5433-4abd-8075-0e536f8b****

TagKey

string

The key of the tag.

k1

ErrorCode

string

The error code.

  • This parameter is returned only if the request fails.

  • For more information, see the Error codes section of this topic.

Code

string

The HTTP status code.

  • 2xx indicates that the request was successful.

  • 3xx indicates that the request was redirected.

  • 4xx indicates that a client-side error occurred.

  • 5xx indicates that a server-side error occurred.

200

Success

boolean

Indicates whether the request was successful. Valid values:

  • true

  • false

true

Examples

Success response

JSON format

{
  "RequestId": "7414187F-4F59-4585-9BCF-5F0804E4****",
  "Message": "success",
  "TraceId": "0bc5f84e15916043198032146d****",
  "Data": {
    "NextToken": "\"\"",
    "TagResources": [
      {
        "ResourceType": "ALIYUN::SAE::APPLICATION",
        "TagValue": "v1",
        "ResourceId": "d42921c4-5433-4abd-8075-0e536f8b****",
        "TagKey": "k1"
      }
    ]
  },
  "ErrorCode": "",
  "Code": "200",
  "Success": true
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidParameter.Obviously The specified parameter is invalid {%s}.
400 InvalidResourceType.NotFound The specified resource type is not supported.
400 NumberExceed.Tags The specified parameter Tags count exceed.
400 Invalid.Param.Tag.Scope The specified parameter is invalid: tag scope.
400 No.Permission The account has no permission.
400 NumberExceed.ResourceIds The number of resource IDs cannot exceed 50.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.