DescribeActivations

Updated at:

Queries created activation codes and their usage.

Operation description

Operation description

You can view the returned data in one of the following two ways:

  • Method 1: When paged query the first page, specify only MaxResults to limit the number of entries to return. The NextToken value in the response is used as the token to query the next page. When paged query the next page, set the NextToken parameter to the NextToken value obtained from the previous response, and specify MaxResults to limit the number of entries to return.

  • Method 2: Specify PageSize to set the number of entries to return per page, and specify PageNumber to set the page number. You can use only one of the two methods. If you specify the MaxResults or NextToken parameter, the PageSize and PageNumber request parameters become invalid, and the TotalCount value in the response is invalid.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

ecs:DescribeActivations

get

Activation

acs:ecs:{#regionId}:{#accountId}:activation/*

Activation

acs:ecs:{#regionId}:{#accountId}:activation/{#activationId}

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), Hong Kong (China), Singapore, Japan (Tokyo), US (Silicon Valley), and US (Virginia).

You can invoke the DescribeRegions operation to query region IDs and other information.

cn-hangzhou

ActivationId

string

No

The activation code ID.

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

Settings for the number of entries to return per page in a paged query. This parameter is used for paging.

Maximum value: 50.

Default value: 10.

10

MaxResults

integer

No

The maximum number of entries to return per page in a paged query. This parameter is used for paging.

Maximum value: 50.

Default value: 10.

10

NextToken

string

No

The query token. The value is the NextToken value returned from the previous API call.

AAAAAdDWBF2****

ResourceGroupId

string

No

The ID of the resource group to which the activation code belongs.

rg-123******

Tag

array<object>

No

The list of tags.

object

No

The list of tags.

Key

string

No

The tag key of the managed instance activation code (dynamic code). Valid values of N: 1 to 20. The tag key cannot be an empty string.

If you use a single tag to filter resources, the resource count that matches the tag cannot exceed 1,000. If you use multiple tags to filter resources, the resource count of resources to which you attach multiple tags cannot exceed 1,000. If the resource count exceeds 1,000, use the ListTagResources operation to query the resources.

The tag key can be up to 64 characters in length. It cannot start with aliyun or acs:, and cannot contain http:// or https://.

TestKey

Value

string

No

The tag value of the managed instance 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 http:// or https://.

TestValue

Response elements

Element

Type

Description

Example

object

PageSize

integer

Settings for the number of entries returned per page in a paged query. This parameter is used for paging.

10

RequestId

string

The request ID.

4ECEEE12-56F1-4FBC-9AB1-890F74625134

PageNumber

integer

The current page number.

1

TotalCount

integer

The total number of record entries that meet the conditional query.

Note

If you use the MaxResults and NextToken parameters for a paged query (paging), the returned TotalCount value is meaningless.

1

NextToken

string

The query token returned by the current call.

AAAAAdDWBF2****

ActivationList

array<object>

The collection of activation codes and their usage information.

array<object>

CreationTime

string

The creation time. The time follows the ISO 8601 standard in the UTC time zone.

2021-01-20T06:00:00Z

DeregisteredCount

integer

The number of deregistered instances.

1

InstanceCount

integer

The maximum number of times 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 registered instances.

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 the 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 activation code ID.

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 tag information of the managed instance activation code.

object

The tag information of the managed instance activation code.

TagKey

string

The tag key of the managed instance activation code.

owner

TagValue

string

The tag value of the managed instance 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 InvalidParameterCharacter The specified parameter %s contains illegal characters.
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.