All Products
Search
Document Center

Cloud Storage Gateway:ListTagResources

Last Updated:Dec 03, 2025

Lists the tags attached to one or more gateways.

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

hcs-sgw:ListTagResources

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

ResourceRegionId

string

No

The ID of the resource region.

cn-hangzhou

ResourceType

string

Yes

The resource type. The value must be GATEWAY.

GATEWAY

NextToken

string

No

The token that is used to retrieve the next page of results. You do not need to specify this parameter for the first request. If the number of results exceeds the page size, you can use the token that is returned for the previous request to retrieve the next page of results.

212db86sca4384811e0b5e8707ec21345

ResourceId

array

No

The IDs of gateways. You can query the tags of N gateways at a time.

Note
  • You must specify at least one of ResourceId and Tag.

gw-uf6wjk5xxxxxxx

string

No

The IDs of gateways. You can query the tags of N gateways at a time. N can be an integer from 1 to 50.

Note

You must specify at least one of ResourceId.N and Tag.N.Key.

gw-uf6wjk5xxxxxxx

Tag

array<object>

No

The tags.

Note
  • You must specify at least one of ResourceId and Tag.

object

No

Key

string

No

The tag key. You can query N tag keys at a time. N can be an integer from 1 to 20. The tag key cannot be an empty string.

Note

You must specify at least one of ResourceId.N and Tag.N.Key.

testkey1

Value

string

No

The tag value of the tag key. You can query N tag values at a time. N can be an integer from 1 to 20. The tag value can be an empty string.

testvalue1

Response elements

Element

Type

Description

Example

object

NextToken

string

If not all results are returned in a query, you can use the token that is returned for the previous query to retrieve the next page of results.

212db86sca4384811e0b5e8707ec21345

RequestId

string

The request ID.

47A514A1-4B77-4E30-B4C5-2A880650B3FD

TagResources

object

TagResource

array<object>

The information about the queried gateways and tags.

object

ResourceType

string

The resource type. ALIYUN::HCS_SGW::GATEWAY indicates a Cloud Storage Gateway.

ALIYUN::HCS_SGW::GATEWAY

TagValue

string

The tag value of the tag key.

testvalue1

ResourceId

string

The gateway ID.

47A514A1-4B77-4E30-B4C5-2A880650B3FD

TagKey

string

The tag key.

testkey1

Examples

Success response

JSON format

{
  "NextToken": "212db86sca4384811e0b5e8707ec21345",
  "RequestId": "47A514A1-4B77-4E30-B4C5-2A880650B3FD",
  "TagResources": {
    "TagResource": [
      {
        "ResourceType": "ALIYUN::HCS_SGW::GATEWAY",
        "TagValue": "testvalue1",
        "ResourceId": "47A514A1-4B77-4E30-B4C5-2A880650B3FD\t",
        "TagKey": "testkey1\t"
      }
    ]
  }
}

Error codes

HTTP status code

Error code

Error message

Description

400 MissingParameter.ResourceIds The parameter - ResourceIds.N should not be null.
400 MissingParameter.Tags The parameter - Tags should not be null.
400 Missing.TagKey The Tag.N.Key parameter is blank.
400 InvalidParameter.TagKey The Tag.N.Key parameter is invalid.
400 InvalidParameter.TagValue The Tag.N.Value parameter is invalid.
400 InvalidParameter.ResourceType The ResourceType parameter is invalid.
400 Duplicate.TagKey The Tag.N.Key contain duplicate key.
400 MissingParameter.TagOrResourceId The specified Tags and ResourcesIds are not allow to both empty.
400 NumberExceed.ResourceIds The ResourceIds parameter's number is exceed , Valid : 50
400 NumberExceed.Tags The Tags parameter's number is exceed , Valid : 20
403 PermissionDenied.Scope The specified operator not have permission to set Scope value.
403 PermissionDenied.TagOwnerUid The specified operator not have permission to set TagOwnerUid value.
403 PermissionDenied.TagOwnerBid The specified operator not have permission to set TagOwnerBid value.
403 NoPermissionKey.Operator These keys are not permission for this operator.
403 NoPermissionKey.Scope These keys are not permission for this scope.
403 NoPermissionKey.Category These keys are not permission for this category.
403 NoPermission.SystemTag The operator is not permission for the system tag.
403 NoPermission.Operator The operator is not permission for this operate.
404 InvalidResourceType.NotFound The ResourceType provided does not exist in our records.
404 InvalidResourceId.NotFound The specified ResourceId is not found in our records.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.