You can call this operation to list all key versions of a specified CMK.

Request parameters

Parameter Type Required Description
KeyId String Yes The globally unique ID of the CMK.
PageSize Integer No The number of entries to return on each page. Valid values: 0 to 101. Default value: 10.
PageNumber Integer No The number of the page to return. Pages start from page 1. Default value: 1.

Response parameters

Parameter Type Description
RequestId String The ID of the request.
PageSize Integer The number of entries returned per page.
PageNumber Integer The page number of the returned page.
TotalCount Integer The total number of returned key versions.
KeyVersions KeyVersion The array that consists of KeyVersion data.

Examples

Sample requests

https://kms.cn-hangzhou.aliyuncs.com/?Action=ListKeyVersions
&KeyId=<key id>
&PageNumber=1
&PageSize=10
&<Common request parameters>

Sample responses

JSON format

//json response
{
        "RequestId": "1e76f572-4a9b-4be2-a296-ae3069318070",
        "KeyVersions": {
                "KeyVersion": [
                        {
                                "KeyId": "0b30658a-ed1a-4922-b8f7-a673ca9c440b",
                                "KeyVersionId": "1e3304fd-68ac-4d5b-8886-ae5f01a1af61",
                                "CreationDate": "2019-08-06T10:22:03Z"
                        },
                        {
                                "KeyId": "0b30658a-ed1a-4922-b8f7-a673ca9c440b",
                                "KeyVersionId": "2ab1a983-7072-4bbc-a582-584b5bd8ecf3",
                                "CreationDate": "2019-08-06T10:19:18Z"
                        },
                        {
                                "KeyId": "0b30658a-ed1a-4922-b8f7-a673ca9c440b",
                                "KeyVersionId": "6a69c763-388a-4708-9fc0-4322266bf2d0",
                                "CreationDate": "2019-08-06T10:17:04Z"
                        }
                ]
        },
        "TotalCount": 3,
        "PageNumber": 1,
        "PageSize": 10
}

XML format

//xml response
<KMS>
        <RequestId>f71204c4-53cd-4eea-b405-653ba2db7e86</RequestId>
        <KeyVersions>
                <KeyVersion>
                        <KeyId>0b30658a-ed1a-4922-b8f7-a673ca9c440b</KeyId>
                        <KeyVersionId>1e3304fd-68ac-4d5b-8886-ae5f01a1af61</KeyVersionId>
                        <CreationDate>2019-08-06T10:22:03Z</CreationDate>
                </KeyVersion>
                <KeyVersion>
                        <KeyId>0b30658a-ed1a-4922-b8f7-a673ca9c440b</KeyId>
                        <KeyVersionId>2ab1a983-7072-4bbc-a582-584b5bd8ecf3</KeyVersionId>
                        <CreationDate>2019-08-06T10:19:18Z</CreationDate>
                </KeyVersion>
                <KeyVersion>
                        <KeyId>0b30658a-ed1a-4922-b8f7-a673ca9c440b</KeyId>
                        <KeyVersionId>6a69c763-388a-4708-9fc0-4322266bf2d0</KeyVersionId>
                        <CreationDate>2019-08-06T10:17:04Z</CreationDate>
                </KeyVersion>
        </KeyVersions>
        <TotalCount>3</TotalCount>
        <PageNumber>1</PageNumber>
        <PageSize>10</PageSize>
</KMS>