該介面用於建立一個啟用碼,該啟用碼用於將非阿里雲伺服器註冊為阿里雲託管執行個體。
介面說明
介面說明
透過啟用碼將非阿里雲伺服器註冊為阿里雲託管執行個體後,您可以在託管執行個體中使用阿里雲提供的多種線上服務(例如雲端助手、系統維運管理和雲效等服務)。
非阿里雲伺服器的作業系統需要符合以下版本,且伺服器可以存取公網,才可以註冊為阿里雲託管執行個體。
Alibaba Cloud Linux 2/3 及更高版本
CentOS 6/7/8 及更高版本
Debian 8/9/10 及更高版本
Ubuntu 12/14/16/18 及更高版本
CoreOS
OpenSUSE
RedHat 5/6/7 及更高版本
SUSE Linux Enterprise Server 11/12/15 及更高版本
Window Server 2012/2016/2019 及更高版本
在一個阿里雲地域下,您最多可以擁有 10 條託管執行個體啟用碼,一個啟用碼可啟用執行個體上限為 10 個,單個啟用碼有效期上限為 4 小時。
您可以在 ECS 雲端助手頁面的託管執行個體頁籤下,按一下註冊新執行個體,取得啟用碼使用資料。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
ecs:CreateActivation |
create |
*Activation
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| RegionId |
string |
是 |
地域 ID。目前支援的地域:華北 1(青島)、華北 2(北京)、華北 3(張家口)、華北 5(呼和浩特)、華北 6(烏蘭察布)、華東 1(杭州)、華東 2(上海)、華南 1(深圳)、華南 2(河源)、華南 3(廣州)、西南 1(成都)、中國香港、新加坡、日本(東京)、美國(矽谷)、美國(弗吉尼亞)。 您可以呼叫 DescribeRegions 查看地域對應的 ID 等資訊。 |
cn-hangzhou |
| InstanceName |
string |
否 |
預設的執行個體名稱前綴。支援 2~50 個字元,且必須以字母開頭,不能以特殊字元及數字開頭,只可包含特殊字元中的半形句號(.)、底線(_)、短劃線(-)和半形冒號(:),不可以使用 使用該介面建立的啟用碼註冊的執行個體,將使用該名稱作為前綴,產生有序的執行個體名。您也可以在註冊託管執行個體時,指定新的執行個體名稱以覆蓋此預設值。 註冊託管執行個體時,如果指定了 InstanceName 的值,則會產生名稱 |
test-InstanceName |
| Description |
string |
否 |
啟用碼對應的描述。支援 1~100 個字元。 |
This is description. |
| InstanceCount |
integer |
否 |
啟用碼用於註冊託管執行個體的使用次數上限。取值範圍為 1~1000。 預設值為 10。 |
10 |
| TimeToLiveInHours |
integer |
否 |
啟用碼的有效使用時間,過期後將不能用於註冊新的執行個體。單位:小時。可選值:1~4。 預設值為 4 小時。 |
4 |
| IpAddressRange |
string |
否 |
允許使用該啟用碼的主機 IP。取值為對應的 IPv4 位址、IPv6 位址或 CIDR 位址段。 |
0.0.0.0/0 |
| ClientToken |
string |
否 |
保證請求冪等性。從您的用戶端產生一個參數值,確保不同請求間該參數值唯一。ClientToken 只支援 ASCII 字元,且不能超過 64 個字元。更多資訊,請參見如何保證冪等性。 |
123e4567-e89b-12d3-a456-426655440000 |
| ResourceGroupId |
string |
否 |
啟用碼所屬的資源群組 ID。 |
rg-123****** |
| Tag |
array<object> |
否 |
標籤列表。 |
|
|
object |
否 |
標籤列表。 |
||
| Key |
string |
否 |
託管執行個體啟用碼的標籤鍵。N 的取值範圍為 1~20。一旦傳入該值,則不允許為空字串。 使用一個標籤過濾資源,查詢到該標籤下的資源數量不能超過 1000 個。使用多個標籤過濾資源,查詢到同時繫結了多個標籤的資源數量不能超過 1000 個。如果資源數量超過 1000 個,您需要使用 ListTagResources 介面進行查詢。 最多支援 64 個字元,不能以 |
TestKey |
| Value |
string |
否 |
託管執行個體啟用碼的標籤值。N 的取值範圍為 1~20。該值可以為空字串。 最多支援 128 個字元,不能包含 |
TestValue |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| RequestId |
string |
請求 ID。 |
4ECEEE12-56F1-4FBC-9AB1-890F1234**** |
| ActivationCode |
string |
啟用碼的代碼。該代碼僅在呼叫介面時返回一次,後續無法被查詢。因此,請您務必妥善保存返回值。 |
a-hz0ch3SwhOlE1234+Xo32lAZC**** |
| ActivationId |
string |
啟用碼 ID。 |
4ECEEE12-56F1-4FBC-9AB1-890F1234**** |
樣本
正常返回樣本
JSON格式
{
"RequestId": "4ECEEE12-56F1-4FBC-9AB1-890F1234****",
"ActivationCode": "a-hz0ch3SwhOlE1234+Xo32lAZC****",
"ActivationId": "4ECEEE12-56F1-4FBC-9AB1-890F1234****"
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | RegionId.ApiNotSupported | The api is not supported in this region. | |
| 400 | InstanceName.ExceedLimit | Default instance name prefix length exceeds. | |
| 400 | InstanceName.InvalidPattern | Default instance name prefix pattern invalid. | |
| 400 | ActivationDesc.ExceedLimit | Activation description length exceeds. | |
| 400 | ActivationLimitation.Invalid | The specified parameter InstanceCount exceeds the limit of %s. | |
| 400 | AddressRange.InvalidPattern | Address range should be ipv4 address or cidr. | |
| 400 | ActivationCount.ExceedLimit | The count of activation in current region exceeds the limit of %s. | |
| 400 | ActivationTTL.ExceedLimit | The specified parameter TimeToLiveInHours exceeds the limit of %s. | |
| 400 | InvalidTagKey.Malformed | The specified Tag.n.Key is not valid. | |
| 400 | InvalidTagValue.Malformed | The specified Tag.n.Value is not valid. | |
| 400 | NumberExceed.Tags | The Tags parameter number is exceed. | |
| 400 | MissingParameter.TagKey | You must specify Tag.N.Key. | |
| 400 | Duplicate.TagKey | The Tag.N.Key contain duplicate key. | |
| 400 | InvalidClientToken.Malformed | The specified parameter clientToken is not valid. | |
| 500 | InternalError.Dispatch | An error occurred when dispatch the request. | |
| 403 | Operation.Forbidden | The operation is not permitted. | |
| 403 | InvalidStatus.ResourceGroup | You cannot perform an operation on a resource group that is being created or deleted. | |
| 403 | RealNameAuthenticationError | Your account has not passed the real-name authentication yet. | |
| 403 | ManagedInstanceCountExceedLimit | The count of managed instance in current region exceeds the limit of %s. | |
| 403 | IdempotentParameterMismatch | The specified parameter has changed while using an already used clientToken. | |
| 403 | IdempotentProcessing | The previous idempotent request(s) is still processing. | |
| 404 | InvalidRegionId.NotFound | The RegionId provided does not exist in our records. | |
| 404 | InvalidResourceGroup.NotFound | The ResourceGroup provided does not exist in our records. |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。