All Products
Search
Document Center

Resource Management:GetPolicy

Last Updated:Dec 15, 2025

Queries the information about a permission policy.

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

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
PolicyNamestringYes

The name of the permission policy.

The name must be 1 to 128 characters in length and can contain letters, digits, and hyphens (-).

OSS-Administrator
PolicyTypestringYes

The type of the permission policy. Valid values:

  • Custom
  • System
Custom
LanguagestringNo

The language in which you want to return the description of the system permission policy. Valid values:

  • en: English
  • zh-CN: Chinese
  • ja: Japanese
zh-CN

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

Policyobject

The information about the permission policy.

AttachmentCountinteger

The number of references to the permission policy.

0
CreateDatestring

The time when the permission policy was created.

2015-01-23T12:33:18Z
DefaultVersionstring

The default version of the permission policy.

v1
Descriptionstring

The description of the permission policy.

OSS administrator
PolicyDocumentstring

The document of the permission policy.

{ "Statement": [{ "Action": ["oss:*"], "Effect": "Allow", "Resource": ["acs:oss:*:*:*"]}], "Version": "1"}
PolicyNamestring

The name of the permission policy.

OSS-Administrator
PolicyTypestring

The type of the permission policy. Valid values:

  • Custom
  • System
Custom
UpdateDatestring

The time when the permission policy was updated.

2016-01-23T12:33:18Z
RequestIdstring

The request ID.

697852FB-50D7-44D9-9774-530C31EAC572

Examples

Sample success responses

JSONformat

{
  "Policy": {
    "AttachmentCount": 0,
    "CreateDate": "2015-01-23T12:33:18Z",
    "DefaultVersion": "v1",
    "Description": "OSS administrator",
    "PolicyDocument": {
      "Statement": [
        {
          "Action": [
            "oss:*"
          ],
          "Effect": "Allow",
          "Resource": [
            "acs:oss:*:*:*"
          ]
        }
      ],
      "Version": 1
    },
    "PolicyName": "OSS-Administrator",
    "PolicyType": "Custom",
    "UpdateDate": "2016-01-23T12:33:18Z"
  },
  "RequestId": "697852FB-50D7-44D9-9774-530C31EAC572"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameter.PolicyTypeThe specified policy type is invalid.The specified policy type is invalid.
400InvalidParameter.PolicyName.InvalidCharsThe policy name contains invalid characters. It must only contain upper or lower case letters, numbers, and dash (-).The policy name contains invalid characters. It must only contain upper or lower case letters, numbers, and dash (-).
400InvalidParameter.PolicyName.LengthThe length of the policy name is invalid. It must be 1 to 128 characters in length.The maximum length of the policy name is exceeded. It must be 1 to 128 characters in length.
404EntityNotExist.PolicyThe policy does not exist.The policy does not exist.

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

Change history

Change timeSummary of changesOperation
No change history