All Products
Search
Document Center

:ListPolicies

Last Updated:Jan 19, 2024

Queries policies.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action String Yes ListPolicies

The operation that you want to perform. Set the value to ListPolicies.

PolicyType String No Custom

The policy type. If you do not configure this parameter, all types of policies are returned. Valid values:

  • Custom
  • System
PageNumber Integer No 1

The page number.

Pages start from page 1. Default value: 1.

PageSize Integer No 10

The number of entries per page.

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

Language String No zh-CN

The language that is used to return the description of the system policy. Valid values:

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

Response parameters

Parameter

Type

Example

Description

TotalCount Integer 2

The total number of entries returned.

Policies Array of Policy

The information about the policies.

Policy
DefaultVersion String v1

The default version of the policy.

Description String OSS administrator

The description of the policy.

UpdateDate String 2016-02-11T18:39:12Z

The time when the policy was modified.

AttachmentCount Integer 1

The number of times the policy is referenced.

PolicyName String OSS-Administrator

The name of the policy.

CreateDate String 2015-01-23T12:33:18Z

The time when the policy was created.

PolicyType String Custom

The type of the policy. Valid values:

  • Custom
  • System
RequestId String 7B8A4E7D-6CFF-471D-84DF-195A7A241ECB

The request ID.

PageSize Integer 10

The number of entries per page.

PageNumber Integer 1

The page number.

Examples

Sample requests

https://resourcemanager.aliyuncs.com/?Action=ListPolicies
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<ListPoliciesResponse>
    <RequestId>7B8A4E7D-6CFF-471D-84DF-195A7A241ECB</RequestId>
    <PageNumber>1</PageNumber>
    <PageSize>10</PageSize>
    <TotalCount>2</TotalCount>
    <Policies>
        <Policy>
            <PolicyName>OSS-Administrator</PolicyName>
            <PolicyType>Custom</PolicyType>
            <Description>OSS administrator</Description>
            <DefaultVersion>v1</DefaultVersion>
            <CreateDate>2015-01-23T12:33:18Z</CreateDate>
            <UpdateDate>2015-01-23T12:33:18Z</UpdateDate>
            <AttachmentCount>1</AttachmentCount>
        </Policy>
        <Policy>
            <PolicyName>ReadOnlyAccess</PolicyName>
            <PolicyType>System</PolicyType>
            <Description>Read-only access</Description>
            <DefaultVersion>v1</DefaultVersion>
            <CreateDate>2015-02-11T18:39:12Z</CreateDate>
            <UpdateDate>2015-02-11T18:39:12Z</UpdateDate>
            <AttachmentCount>2</AttachmentCount>
        </Policy>
    </Policies>
</ListPoliciesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
  "PageNumber" : 1,
  "PageSize" : 10,
  "TotalCount" : 2,
  "Policies" : {
    "Policy" : [ {
      "PolicyName" : "OSS-Administrator",
      "PolicyType" : "Custom",
      "Description" : "OSS administrator",
      "DefaultVersion" : "v1",
      "CreateDate" : "2015-01-23T12:33:18Z",
      "UpdateDate" : "2015-01-23T12:33:18Z",
      "AttachmentCount" : 1
    }, {
      "PolicyName" : "ReadOnlyAccess",
      "PolicyType" : "System",
      "Description" : "Read-only access",
      "DefaultVersion" : "v1",
      "CreateDate" : "2015-02-11T18:39:12Z",
      "UpdateDate" : "2015-02-11T18:39:12Z",
      "AttachmentCount" : 2
    } ]
  }
}

Error codes

For a list of error codes, see Service error codes.