All Products
Search
Document Center

Resource Management:GetPermission

Last Updated:Mar 22, 2024

Queries the information about a permission.

Operation description

This topic provides an example on how to call the API operation to query the information about the AliyunRSDefaultPermissionVSwitch permission whose version is v1 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:GetPermissionRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
PermissionNamestringYes

The name of the permission.

AliyunRSDefaultPermissionVSwitch
PermissionVersionstringNo

The version of the permission.

v1

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

2F23CFB6-A721-4E90-AC1E-0E30FA8B45DA
Permissionobject

The information about the permission.

PermissionNamestring

The name of the permission.

AliyunRSDefaultPermissionVSwitch
PermissionVersionstring

The version of the permission.

v1
Permissionstring

The document of the policy related to the permission.

{"Effect":"Allow","Action":["vpc:DescribeVSwitches","vpc:DescribeVSwitchAttributes"]}
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
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
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

{
  "RequestId": "2F23CFB6-A721-4E90-AC1E-0E30FA8B45DA",
  "Permission": {
    "PermissionName": "AliyunRSDefaultPermissionVSwitch",
    "PermissionVersion": "v1",
    "Permission": "{\"Effect\":\"Allow\",\"Action\":[\"vpc:DescribeVSwitches\",\"vpc:DescribeVSwitchAttributes\"]}",
    "ResourceType": "VSwitch",
    "DefaultVersion": true,
    "CreateTime": "2020-12-07T07:39:01.818Z",
    "UpdateTime": "2020-12-07T07:39:01.818Z",
    "DefaultPermission": true
  }
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameter.PermissionVersionThe PermissionVersion is invalid.The value of PermissionVersion is invalid.
400MissingParameter.PermissionNameYou must specify PermissionName.PermissionName is not configured.
404EntityNotExists.PermissionThe resource share permission does not exist.You do not have the required permissions.

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

Change history

Change timeSummary of changesOperation
No change history