All Products
Search
Document Center

:ListTagResources

Last Updated:Nov 01, 2024

Queries the mapping relationships between applications and tags.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
sae:ListTagResourcesget
  • All Resources
    *
    none
none

Request syntax

GET /tags HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

cn-beijing

cn-beijing
ResourceTypestringYes

application

application
NextTokenstringNo

A2RN

A2RN
ResourceIdsstringNo

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

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

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

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

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

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

The returned message.

success
TraceIdstring

The ID of the trace. It can be used to query the details of a request.

0bc5f84e15916043198032146d****
Dataobject

The returned data.

NextTokenstring

A maximum of 50 entries can be returned for a query. If a query generates more than 50 entries, the NextToken parameter is returned with the first 50 entries. You can use the NextToken parameter value to retrieve the subsequent entries that are not returned in the current query result.

""
TagResourcesarray<object>

The mapping relationships between applications and tags.

TagResourceobject
ResourceTypestring

The type of the resource. Set the value to application.

ALIYUN::SAE::APPLICATION
TagValuestring

The tag value.

v1
ResourceIdstring

The ID of the application.

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

The tag key.

k1
ErrorCodestring

The error code.

  • The ErrorCode parameter is not returned when the request succeeds.
  • The ErrorCode parameter is returned when the request fails. For more information, see Error codes in this topic.
Codestring

The HTTP status code. Valid values:

  • 2xx: indicates that the request was successful.
  • 3xx: indicates that the request was redirected.
  • 4xx: indicates that the request was invalid.
  • 5xx: indicates that a server error occurred.
200
Successboolean

Indicates whether mapping relationships between applications and tags were queried successfully. Valid values:

  • true: The query was successful.
  • false: The query failed.
true

Examples

Sample success responses

JSONformat

{
  "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 codeError codeError message
400InvalidParameter.ObviouslyThe specified parameter is invalid {%s}.
400InvalidResourceType.NotFoundThe specified resource type is not supported.
400NumberExceed.TagsThe specified parameter Tags count exceed.
400Invalid.Param.Tag.ScopeThe specified parameter is invalid: tag scope.
400No.PermissionThe account has no permission.
400NumberExceed.ResourceIdsThe number of resource IDs cannot exceed 50.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history