Lists policies.

Debug

Use OpenAPI Explorer to perform debug operations and generate SDK code examples.

Request parameters

Parameter Type Required? Example value Description
Action String Yes ListPolicies

The name of this action.

Value: ListPolicies

Marker String No EXAMPLE The marker. If part of a response is intercepted, you can use this parameter to obtain the intercepted content.
MaxItems Integer No 100

The number of permitted response items. If a response is intercepted when it reaches the maximum value of this parameter, the value of IsTruncated is true.

Value range: 1 to 1,000

Default value: 100

PolicyType String No System

The policy type. If this parameter is not set, all polices are listed.

Valid values: System | Custom

Response parameters

Parameter Type Example value Description
IsTruncated Boolean true Indicates whether a response is intercepted.
Marker String EXAMPLE This parameter is available only when the value of IsTruncated is true. In which case, you can call this action and use the specific marker to obtain the intercepted content.
Policies N/A N/A The policy list.
AttachmentCount Integer 3 The number of times that a policy is referenced.
CreateDate String 2015-01-23T12:33:18Z The date and time when a policy was created.
DefaultVersion String v1 The default version.
Description String OSS administrator The policy description.
PolicyName String OSS-Administrator The policy name.
PolicyType String System The policy type.
UpdateDate String 2015-01-23T12:33:18Z The date and time when a policy was modified.
RequestId String 7B8A4E7D-6CFF-471D-84DF-195A7A241ECB The request ID.

Example

Request example

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

Response example

XML format

<ListPoliciesResponse>
  <RequestId>7B8A4E7D-6CFF-471D-84DF-195A7A241ECB</RequestId>
  <IsTruncated>true</IsTruncated>
  <Marker>EXAMPLE</Marker>
  <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>0</AttachmentCount>
    </Policy>
    <Policy>
      <PolicyName>ReadOnlyAccess</PolicyName>
      <PolicyType>System</PolicyType>
      <Description>Read-only permission</Description>
      <DefaultVersion>v1</DefaultVersion>
      <CreateDate>2015-02-11T18:39:12Z</CreateDate>
      <UpdateDate>2015-02-19T09:43:16Z</UpdateDate>
      <AttachmentCount>0</AttachmentCount>
    </Policy>
  </Policies>
</ListPoliciesResponse>

JSON format

{
    "Policies":{
        "Policy":[
            {
                "AttachmentCount":3,
                "Description":"OSS administrator",
                "PolicyName":"OSS-Administrator",
                "UpdateDate":"2015-01-23T12:33:18Z",
                "CreateDate":"2015-01-23T12:33:18Z",
                "DefaultVersion":"v1",
                "PolicyType":"Custom"
            },
            {
                "AttachmentCount":1,
                "Description":"Read-only permission",
                "PolicyName":"ReadOnlyAccess",
                "UpdateDate":"2015-02-19T09:43:16Z",
                "CreateDate":"2015-02-11T18:39:12Z",
                "DefaultVersion":"v1",
                "PolicyType":"System"
            }
        ]
    },
    "IsTruncated":true,
    "RequestId":"7B8A4E7D-6CFF-471D-84DF-195A7A241ECB",
    "Marker":"EXAMPLE"
}

Errors

For a list of error codes, visit the API Error Center.