Queries existing activation codes and their usage information.
Usage notes
You can use one of the following methods to check the responses:
Method 1: When you call the DescribeActivations operation to retrieve the first page of results during a paged query, use
MaxResults
to specify the maximum number of entries to return in the call. The return value ofNextToken
is a pagination token, which you can use in the next request to retrieve a new page of results. When you call the DescribeActivations operation to retrieve a new page of results, setNextToken
to theNextToken
value returned in the previous call and useMaxResults
to specify the maximum number of entries to return in this call.Method 2: Use
PageSize
to specify the number of entries to return on each page, and then usePageNumber
to specify the number of the page to return. You can use only one of the preceding methods. If you specifyMaxResults
orNextToken
, thePageSize
andPageNumber
request parameters do not take effect and theTotalCount
response parameter is invalid.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
Action | String | Yes | DescribeActivations | The operation that you want to perform. Set the value to DescribeActivations. |
RegionId | String | Yes | cn-hangzhou | The region ID of the activation code. Supported regions: China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Ulanqab), China (Hangzhou), China (Shanghai), China (Shenzhen), China (Heyuan), China (Guangzhou), China (Chengdu), China (Hong Kong), Singapore, Japan (Tokyo), US (Silicon Valley), and US (Virginia). You can call the DescribeRegions operation to query the most recent region list. |
ActivationId | String | No | 4ECEEE12-56F1-4FBC-9AB1-890F1234**** | The activation code ID. |
InstanceName | String | No | test-InstanceName | The default instance name prefix. |
PageNumber | Long | No | 1 | The page number. Pages start from page 1. Default value: 1. |
PageSize | Long | No | 10 | The number of entries per page. Valid values: 1 to 50. Default value: 10. |
MaxResults | Integer | No | 10 | The maximum number of entries per page. Valid values: 1 to 50. Default value: 10. |
NextToken | String | No | AAAAAdDWBF2**** | The pagination token that is used in the next request to retrieve a new page of results. You do not need to specify this parameter for the first request. You must specify the token that is obtained from the previous query as the value of NextToken. |
ResourceGroupId | String | No | rg-123****** | The ID of the resource group to which the activation code belongs. |
Tag.N.Key | String | No | TestKey | The key of tag N of the activation code. Valid values of N: 1 to 20. The tag key cannot be an empty string. If a single tag is specified to query resources, up to 1,000 resources that have this tag added can be returned. If multiple tags are specified to query resources, up to 1,000 resources that have all these tags added can be returned. To query more than 1,000 resources to which the specified tags are added, call the ListTagResources operation. The tag key can be up to 64 characters in length and cannot contain |
Tag.N.Value | String | No | TestValue | The value of tag N of the activation code. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot contain |
Response parameters
Parameter | Type | Example | Description |
PageSize | Long | 10 | The number of entries per page. |
RequestId | String | 4ECEEE12-56F1-4FBC-9AB1-890F74625134 | The request ID. |
PageNumber | Long | 1 | The page number. |
TotalCount | Long | 1 | The total number of entries returned. |
NextToken | String | AAAAAdDWBF2**** | A pagination token. It can be used in the next request to retrieve a new page of results. |
ActivationList | Array of Activation | The activation codes and their usage information. | |
CreationTime | String | 2021-01-20T06:00:00Z | The time when the activation code was created. |
DeregisteredCount | Integer | 1 | The number of instances that were deregistered. |
InstanceCount | Integer | 1 | The maximum number of times that you can use the activation code to register managed instances. |
Description | String | This is description. | The description of the activation code. |
RegisteredCount | Integer | 1 | The number of instances that were registered. |
InstanceName | String | test-InstanceName | The default instance name prefix. |
Disabled | Boolean | false | Indicates whether the activation code is disabled. |
IpAddressRange | String | 0.0.0.0/0 | The IP addresses of the hosts that can use the activation code. |
TimeToLiveInHours | Long | 4 | The validity period of the activation code. Unit: hours. |
ActivationId | String | 4ECEEE12-56F1-4FBC-9AB1-890F1234**** | The activation code ID. |
ResourceGroupId | String | rg-123****** | The ID of the resource group to which the activation code belongs. |
Tags | Array of Tag | The tags of the activation code. | |
TagKey | String | owner | The tag key of the activation code. |
TagValue | String | zhangsan | The tag value of the activation code. |
Examples
Sample requests
https://ecs.aliyuncs.com/?Action=DescribeActivations
&RegionId=cn-hangzhou
&ActivationId=4ECEEE12-56F1-4FBC-9AB1-890F1234****
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeActivationsResponse>
<TotalCount>1</TotalCount>
<PageSize>10</PageSize>
<RequestId>4ECEEE12-56F1-4FBC-9AB1-890F74942176</RequestId>
<PageNumber>1</PageNumber>
<ActivationList>
<InstanceName>test-InstanceName</InstanceName>
<DeregisteredCount>1</DeregisteredCount>
<InstanceCount>1</InstanceCount>
<Description>This is description.</Description>
<CreationTime>2021-01-20T06:00:00Z</CreationTime>
<ActivationId>4ECEEE12-56F1-4FBC-9AB1-890F1234****</ActivationId>
<RegisteredCount>1</RegisteredCount>
<TimeToLiveInHours>4</TimeToLiveInHours>
<Disabled>false</Disabled>
<IpAddressRange>0.0.0.0/0</IpAddressRange>
</ActivationList>
</DescribeActivationsResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"TotalCount" : "1",
"PageSize" : "10",
"RequestId" : "4ECEEE12-56F1-4FBC-9AB1-890F74942176",
"PageNumber" : "1",
"ActivationList" : [ {
"InstanceName" : "test-InstanceName",
"DeregisteredCount" : "1",
"InstanceCount" : "1",
"Description" : "This is description.",
"CreationTime" : "2021-01-20T06:00:00Z",
"ActivationId" : "4ECEEE12-56F1-4FBC-9AB1-890F1234****",
"RegisteredCount" : "1",
"TimeToLiveInHours" : "4",
"Disabled" : "false",
"IpAddressRange" : "0.0.0.0/0"
} ]
}
Error codes
HttpCode | Error code | Error message | Description |
400 | RegionId.ApiNotSupported | The api is not supported in this region. | This operation cannot be performed in the specified region. Check whether the value of RegionId is valid. |
400 | InvalidParam.PageNumber | The specified parameter is invalid. | Invalid PageNumber value. |
400 | InvalidParam.PageSize | The specified parameter is invalid. | Invalid PageSize value. |
400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | Invalid Tag.N.Key value. |
400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | Invalid Tag.N.Value value. |
400 | NumberExceed.Tags | The Tags parameter number is exceed. | The number of tags exceeds the upper limit. |
400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | The tag key already exists. Tag keys must be unique. |
400 | MissingParameter.TagKey | You must specify Tag.N.Key. | Tag.N.Key is required. |
400 | InvalidParameter.NextToken | The specified parameter NextToken is not valid. | Invalid NextToken value. |
400 | InvalidParameter.MaxResults | The specified parameter MaxResults is not valid. | Invalid MaxResults value. |
403 | Operation.Forbidden | The operation is not permitted. | The operation is not supported. |
500 | InternalError.Dispatch | An error occurred when you dispatched the request. | An error occurred while the request was being sent. Try again later. |
For a list of error codes, see Service error codes.