All Products
Search
Document Center

Resource Management:ListResourceSharePermissions

Last Updated:Mar 22, 2024

Queries the permissions that are associated with a resource share.

Operation description

This topic provides an example on how to call the API operation to query the permissions that are associated with the resource share created by using the current Alibaba Cloud account in the cn-hangzhou region.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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
resourcesharing:ListResourceSharePermissionsList
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ResourceShareIdstringYes

The ID of the resource share.

rs-6GRmdD3X****
MaxResultsintegerNo

The maximum number of entries to return for a single request.

Valid values: 1 to 100. Default value: 20.

20
NextTokenstringNo

The token that is used to initiate the next request. If the response of the current request is truncated, you can use the token to initiate another request and obtain the remaining records.

TGlzdFJlc291cm****
ResourceOwnerstringYes

The owner of the resource share. Valid values:

  • Self: the current account
  • OtherAccounts: an account other than the current account
Self

Response parameters

ParameterTypeDescriptionExample
object
NextTokenstring

The token that is used to initiate the next request. If the response of the current request is truncated, you can use the token to initiate another request and obtain the remaining records.

TGlzdFJlc291cm****
RequestIdstring

The ID of the request.

2F23CFB6-A721-4E90-AC1E-0E30FA8B45DA
Permissionsobject []

The information about the permissions.

PermissionNamestring

The name of the permission.

AliyunRSDefaultPermissionVSwitch
PermissionVersionstring

The version of the permission.

v1
DefaultVersionboolean

Indicates whether the version is the default version. Valid values:

  • false: The version is not the default version.
  • true: The version is the default version.
true
CreateTimestring

The creation time.

2020-12-07T07:39:01.818Z
UpdateTimestring

The update time.

2020-12-07T07:39:01.818Z
ResourceTypestring

The type of the shared resources.

For more information about the types of resources that can be shared, see Services that work with Resource Sharing.

VSwitch
DefaultPermissionboolean

Indicates whether the permission is the default permission. Valid values:

  • false: The permission is not the default permission.
  • true: The permission is the default permission.
true

Examples

Sample success responses

JSONformat

{
  "NextToken": "TGlzdFJlc291cm****",
  "RequestId": "2F23CFB6-A721-4E90-AC1E-0E30FA8B45DA",
  "Permissions": [
    {
      "PermissionName": "AliyunRSDefaultPermissionVSwitch",
      "PermissionVersion": "v1",
      "DefaultVersion": true,
      "CreateTime": "2020-12-07T07:39:01.818Z",
      "UpdateTime": "2020-12-07T07:39:01.818Z",
      "ResourceType": "VSwitch",
      "DefaultPermission": true
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
400MissingParameter.ResourceShareIdYou must specify ResourceShareId.You must specify ResourceShareId.
400InvalidParameter.ResourceShareIdThe ResourceShareId is invalid.The ResourceShareId parameter is invalid.
400InvalidParameter.MaxResultsThe MaxResults is invalid.The MaxResults parameter is invalid.
400InvalidParameter.NextTokenThe NextToken is invalid.The NextToken parameter is invalid.
400InvalidParameter.NextToken.LengthThe maximum length of NextToken exceeds 256 characters.The length of NextToken cannot exceed 256 characters.
400InvalidParameter.ResourceOwnerThe ResourceOwner is invalid.The ResourceOwner parameter is invalid.
400MissingParameter.ResourceOwnerYou must specify ResourceOwner.You must specify ResourceOwner.
404EntityNotExists.ResourceShareThe resource share does not exist in the current account.The resource share does not exist in the current account.

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

Change history

Change timeSummary of changesOperation
No change history