All Products
Search
Document Center

Key Management Service:ListPolicies

更新時間:Oct 11, 2023

Queries a list of permission 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.

PageNumber

Integer

No

1

The page number. Default value: 1.

PageSize

Integer

No

10

The number of entries per page. Valid values: 1 to 100. Default value: 20.

Response parameters

Parameter

Type

Example

Description

RequestId

String

b66ad557-9c00-4064-9c8d-b621c3263308

The ID of the request, which is used to locate and troubleshoot issues.

PageNumber

Integer

1

The page number.

PageSize

Integer

10

The number of entries per page.

TotalCount

Integer

1

The total number of entries returned.

Policies

Array of Policy

A list of permission policies.

Policy

Name

String

policy_test

The name of the permission policy.

Examples

Sample requests

http(s)://[Endpoint]/?Action=ListPolicies
&PageNumber=1
&PageSize=10
&Common request parameters

Sample success responses

XML format

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

<ListPoliciesResponse>
    <RequestId>b66ad557-9c00-4064-9c8d-b621c3263308</RequestId>
    <PageNumber>1</PageNumber>
    <PageSize>10</PageSize>
    <TotalCount>1</TotalCount>
    <Policies>
        <Name>policy_test</Name>
    </Policies>
</ListPoliciesResponse>

JSON format

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

{
  "RequestId" : "b66ad557-9c00-4064-9c8d-b621c3263308",
  "PageNumber" : 1,
  "PageSize" : 10,
  "TotalCount" : 1,
  "Policies" : [ {
    "Name" : "policy_test"
  } ]
}

Error codes

HTTP status code

Error code

Error message

Description

400

InvalidParameter

The specified parameter is not valid.

The specified parameter is invalid.

404

InvalidAccessKeyId.NotFound

The Access Key ID provided does not exist in our records.

The specified AccessKey ID does not exist.

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