Disables an activation code.

Usage notes

To prevent an activation code from being leaked, you can call the DisableActivation operation to disable the activation code. Disabled activation codes cannot be used to register new managed instances. However, managed instances that are already registered are not affected.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DisableActivation

The operation that you want to perform. Set the value to DisableActivation.

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 Yes 4ECEEE12-56F1-4FBC-9AB1-890F1234****

The activation code ID.

Response parameters

Parameter Type Example Description
RequestId String 4ECEEE12-56F1-4FBC-9AB1-890F74942176

The request ID.

Activation Object

The activation code and its usage information.

CreationTime String 2021-01-20T06:00:00Z

The creation time.

DeregisteredCount Integer 1

The number of instances that were deregistered.

InstanceCount Integer 1

The maximum number of times that the activation code can be used 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 was 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.

Examples

Sample requests

https://ecs.aliyuncs.com/?Action=DisableActivation
&ActivationId=4ECEEE12-56F1-4FBC-9AB1-890F1234****
&RegionId=cn-hangzhou
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DisableActivationResponse>
    <RequestId>4ECEEE12-56F1-4FBC-9AB1-890F74942176</RequestId>
    <Activation>
        <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>
    </Activation>
</DisableActivationResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "4ECEEE12-56F1-4FBC-9AB1-890F74942176",
  "Activation" : {
    "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

HTTP status code 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 region ID is valid.
403 Operation.Forbidden The operation is not permitted. The operation is not supported.
404 ActivationId.NotFound The specified activation id does not exist. The specified activation code is not found.
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.