Creates an activation code. The activation code is used to register servers that are not provided by Alibaba Cloud as Alibaba Cloud managed instances.
Operation description
After you use an activation code to register a server that is not provided by Alibaba Cloud as an Alibaba Cloud managed instance, you can use various online services of Alibaba Cloud, such as Cloud Assistant, CloudOps Orchestration Service (OOS), and Apsara Devops, on the managed instance.
If a server is not provided by Alibaba Cloud, you can register the server as an Alibaba Cloud managed instance only if the server has Internet connectivity and runs an operating system of one of the following versions:
- Alibaba Cloud Linux 2, Alibaba Cloud Linux 3, and later
- CentOS 6, CentOS 7, CentOS 8, and later
- Debian 8, Debian 9, Debian 10, and later
- Ubuntu 12, Ubuntu 14, Ubuntu 16, Ubuntu 18, and later
- CoreOS
- OpenSUSE
- Red Hat 5, Red Hat 6, Red Hat 7, and later
- SUSE Linux Enterprise Server (SLES) 11, SLES 12, SLES 15, and later
- Windows Server 2012, Windows Server 2016, Windows Server 2019, and later
You can have up to 5,000 activation codes per Alibaba Cloud region. When the number of activation codes exceeds 1,000, the usage of the activation codes must be greater than 50% before you can proceed to create more activation codes.
Debugging
Authorization information
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The ID of the region in which to create 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 all the DescribeRegions operation to query the most recent region list. | cn-hangzhou |
InstanceName | string | No | The default instance name prefix. The instance name prefix must be 2 to 50 characters in length. It must start with a letter and cannot start with If you use the activation code that is created by calling this operation (CreateActivation) to register managed instances, the instances are assigned sequential names that are prefixed by the value of this parameter. You can also specify a new instance name to replace the assigned sequential name when you register a managed instance. If you specify InstanceName when you register a managed instance, an instance name in the format of | test-InstanceName |
Description | string | No | The description of the activation code. It must be 1 to 100 characters in length. | This is description. |
InstanceCount | integer | No | The maximum number of times that you can use the activation code to register managed instances. Valid values: 1 to 1000. Default value: 10. | 10 |
TimeToLiveInHours | long | No | The validity period of the activation code. The activation code can no longer be used to register instances after the period expires. Unit: hours. Valid values: 1 to 876576, which represents a range of time from 1 hour to 100 years. Default value: 4. | 4 |
IpAddressRange | string | No | The IP addresses of hosts that can use the activation code. The value can be IPv4 addresses, IPv6 addresses, or CIDR blocks. | 0.0.0.0/0 |
ResourceGroupId | string | No | The ID of the resource group to which to assign the activation code. | rg-123****** |
Tag | object [] | No | The tags to add to the activation code. | |
Key | string | No | The key of tag N to add to 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 displayed in the response. If multiple tags are specified to query resources, up to 1,000 resources that have all these tags added can be displayed in the response. To query more than 1,000 resources that have specified tags, call ListTagResources . The tag key can be up to 64 characters in length and cannot start with | TestKey |
Value | string | No | The value of tag N to add to the activation code. Valid values of N: 1 to 20. The tag value can be an empty string. It can be up to 128 characters in length and cannot contain | TestValue |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "4ECEEE12-56F1-4FBC-9AB1-890F1234****",
"ActivationCode": "a-hz0ch3SwhOlE1234+Xo32lAZC****",
"ActivationId": "4ECEEE12-56F1-4FBC-9AB1-890F1234****"
}
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 | InstanceName.ExceedLimit | Default instance name prefix length exceeds. | The length of the instance name prefix exceeds the upper limit. |
400 | InstanceName.InvalidPattern | Default instance name prefix pattern invalid. | The instance name prefix is invalid. |
400 | ActivationDesc.ExceedLimit | Activation description length exceeds. | The length of the activation code description exceeds the upper limit. |
400 | ActivationLimitation.Invalid | Registration limitation must be positive. | The maximum number of times that the activation code can be used to register managed instances has been reached. |
400 | AddressRange.InvalidPattern | Address range should be ipv4 address or cidr. | The IP addresses of hosts that can use the activation code must be IPv4 addresses, IPv6 addresses, or CIDR blocks. |
400 | ActivationCount.ExceedLimit | Too many activations have been created. | The maximum number of activation codes that can be created is exceeded. |
400 | ActivationTTL.ExceedLimit | Activation TTL exceeds limit. | The validity period of the activation code is out of range. |
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 | MissingParameter.TagKey | You must specify Tag.N.Key. | The tag key is not specified. |
400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | The specified tag key already exists. Tag keys must be unique. |
403 | Operation.Forbidden | The operation is not permitted. | The operation is not supported. |
403 | InvalidStatus.ResourceGroup | You cannot perform an operation on a resource group that is being created or deleted. | Operation not allowed while resource group is being created or deleted. |
404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | The RegionId provided does not exist |
404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. | The specified resource group does not exist. |
500 | InternalError.Dispatch | An error occurred when dispatch the request. | An error occurred while the request is being sent. Try again later. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2023-10-24 | The Error code has changed. The request parameters of the API has changed | see changesets | ||||||||||||||
| ||||||||||||||||
2021-10-15 | The Error code has changed | see changesets | ||||||||||||||
| ||||||||||||||||
2021-10-15 | The Error code has changed | see changesets | ||||||||||||||
|