All Products
Search
Document Center

Resource Management:ListPermissionVersions

Last Updated:Nov 19, 2024

Queries the versions of a permission.

Operation description

This topic provides an example on how to call the API operation to query the versions of the AliyunRSDefaultPermissionVSwitch permission in the cn-hangzhou region.

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

Request parameters

ParameterTypeRequiredDescriptionExample
PermissionNamestringYes

The name of the permission.

AliyunRSDefaultPermissionVSwitch
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****

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.

04677DCA-7C33-464B-8811-1B1DA3C3D197
Permissionsarray<object>

The information about the permission.

Permissionobject

The information about the permission.

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": "04677DCA-7C33-464B-8811-1B1DA3C3D197",
  "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.PermissionNameYou must specify PermissionName.PermissionName is not configured.
400InvalidParameter.ResourceTypeThe ResourceType is invalid.The specified ResourceType 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.

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

Change history

Change timeSummary of changesOperation
No change history