Queries existing activation codes and their usage information.
Operation description
Usage notes
You can use one of the following methods to check the responses:
Method 1: During a paged query, when you call the DescribeActivations operation to retrieve the first page of results, use
MaxResultsto specify the maximum number of entries to return in the call. The return value ofNextTokenis 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, setNextTokento theNextTokenvalue returned in the previous call and setMaxResultsto specify the maximum number of entries to return in this call.Method 2: Use
PageSizeto specify the number of entries to return on each page, and then usePageNumberto specify the number of the page to return. You can use only one of the preceding methods. If you specifyMaxResultsorNextToken, thePageSizeandPageNumberrequest parameters do not take effect and theTotalCountresponse parameter is invalid.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
ecs:DescribeActivations |
get |
Activation
Activation
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID. 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. |
cn-hangzhou |
| RegionId |
string |
Yes |
The region ID. 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. |
cn-hangzhou |
| ActivationId |
string |
No |
The ID of the activation code. |
4ECEEE12-56F1-4FBC-9AB1-890F1234**** |
| InstanceName |
string |
No |
The default instance name prefix. |
test-InstanceName |
| PageNumber |
integer |
No |
The page number. Pages start from page 1. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Valid values: 1 to 50. Default value: 10. |
10 |
| MaxResults |
integer |
No |
The maximum number of entries per page. Valid values: 1 to 50. Default value: 10. |
10 |
| NextToken |
string |
No |
The pagination token that is used in the next request to retrieve a new page of results. You must specify the token that is obtained from the previous query as the value of NextToken. |
AAAAAdDWBF2**** |
| ResourceGroupId |
string |
No |
The ID of the resource group to which the activation code belongs. |
rg-123****** |
| Tag |
array<object> |
No |
The tags of the activation code. |
|
|
object |
No |
The tag of the activation code. |
||
| Key |
string |
No |
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 can be returned. If multiple tags are specified to query resources, up to 1,000 resources that have all these tags can be returned. To query more than 1,000 resources that have specified tags, call the ListTagResources operation. The tag key can be up to 64 characters in length and cannot start with |
TestKey |
| Value |
string |
No |
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 |
TestValue |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| PageSize |
integer |
The number of entries per page. |
10 |
| RequestId |
string |
The request ID. |
4ECEEE12-56F1-4FBC-9AB1-890F74625134 |
| PageNumber |
integer |
The page number. |
1 |
| TotalCount |
integer |
The total number of entries returned. |
1 |
| NextToken |
string |
A pagination token. It can be used in the next request to retrieve a new page of results. |
AAAAAdDWBF2**** |
| ActivationList |
array<object> |
The activation codes and their usage information. |
|
|
array<object> |
|||
| CreationTime |
string |
The time when the activation code was created. |
2021-01-20T06:00:00Z |
| DeregisteredCount |
integer |
The number of instances that were deregistered. |
1 |
| InstanceCount |
integer |
The maximum number of times that the activation code can be used to register managed instances. |
1 |
| Description |
string |
The description of the activation code. |
This is description. |
| RegisteredCount |
integer |
The number of instances that were registered. |
1 |
| InstanceName |
string |
The default instance name prefix. |
test-InstanceName |
| Disabled |
boolean |
Indicates whether the activation code is disabled. |
false |
| IpAddressRange |
string |
The IP addresses of hosts that are allowed to use the activation code. |
0.0.0.0/0 |
| TimeToLiveInHours |
integer |
The validity period of the activation code. Unit: hours. |
4 |
| ActivationId |
string |
The ID of the activation code. |
4ECEEE12-56F1-4FBC-9AB1-890F1234**** |
| ResourceGroupId |
string |
The ID of the resource group to which the activation code belongs. |
rg-123****** |
| Tags |
array<object> |
The tags of the activation code. |
|
|
object |
The tag of the activation code. |
||
| TagKey |
string |
The tag key of the activation code. |
owner |
| TagValue |
string |
The tag value of the activation code. |
zhangsan |
Examples
Success response
JSON format
{
"PageSize": 10,
"RequestId": "4ECEEE12-56F1-4FBC-9AB1-890F74625134",
"PageNumber": 1,
"TotalCount": 1,
"NextToken": "AAAAAdDWBF2****",
"ActivationList": [
{
"CreationTime": "2021-01-20T06:00:00Z",
"DeregisteredCount": 1,
"InstanceCount": 1,
"Description": "This is description.",
"RegisteredCount": 1,
"InstanceName": "test-InstanceName",
"Disabled": false,
"IpAddressRange": "0.0.0.0/0",
"TimeToLiveInHours": 4,
"ActivationId": "4ECEEE12-56F1-4FBC-9AB1-890F1234****",
"ResourceGroupId": "rg-123******",
"Tags": [
{
"TagKey": "owner",
"TagValue": "zhangsan"
}
]
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | RegionId.ApiNotSupported | The api is not supported in this region. | The API operation cannot be called in the specified region. Check whether the specified RegionId parameter is valid. |
| 400 | InvalidParam.PageNumber | The specified parameter is invalid. | |
| 400 | InvalidParam.PageSize | The specified parameter is invalid. | |
| 400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | The specified Tag.N.Key parameter is invalid. |
| 400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | The specified tag value is invalid. |
| 400 | NumberExceed.Tags | The Tags parameter number is exceed. | The number of tags exceeds the maximum limit. |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | The specified tag key already exists. Tag keys must be unique. |
| 400 | MissingParameter.TagKey | You must specify Tag.N.Key. | The tag key is not specified. |
| 400 | InvalidParameter.NextToken | The specified parameter NextToken is not valid. | The specified parameter NextToken is illegal. |
| 400 | InvalidParameter.MaxResults | The specified parameter MaxResults is not valid. | The specified parameter MaxResults is illegal. |
| 500 | InternalError.Dispatch | An error occurred when you dispatched the request. | An error occurred while the request is being sent. Try again later. |
| 403 | Operation.Forbidden | The operation is not permitted. | The operation is not supported. |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | Region information error |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.