tke — Kubernetes Engine
tke · 2018-05-25
AddExistedInstances
POST
Add one or more existing instances to a cluster.
Wire call
Converge Cloud is RPC over HTTP. There is one path — / — and the action travels in the X-TC-Action header. The /tke/AddExistedInstances path used in the OpenAPI document is a documentation convenience so each action is addressable; it is not a route on the server.
curl
curl -sS https://tke.api3.convergecloud.com/ \
-H 'Authorization: TC3-HMAC-SHA256 Credential=<SecretId>/<YYYY-MM-DD>/tke/tc3_request, SignedHeaders=content-type;host;x-tc-action, Signature=<sig>' \
-H 'Content-Type: application/json; charset=utf-8' \
-H 'Host: tke.api3.convergecloud.com' \
-H 'X-TC-Action: AddExistedInstances' \
-H 'X-TC-Version: 2018-05-25' \
-H 'X-TC-Timestamp: <unix-seconds>' \
-H 'X-TC-Region: luzon' \
-d '{"ClusterId":"<ClusterId>","InstanceIds":["<InstanceId>"]}'Request parameters
| Field | Type | Required | Description |
|---|---|---|---|
| ClusterId | string | Yes | Cluster ID |
| InstanceIds | string[] | Yes | Instance list. Spot instance is not supported. |
| InstanceAdvancedSettings | InstanceAdvancedSettings | No | Detailed information of the instance |
| EnhancedService | EnhancedService | No | Enhanced services. This parameter is used to specify whether to enable Cloud Security, Cloud Monitoring and other services. If this parameter is not specified, Cloud Monitor and Cloud Security are enabled by default. |
| LoginSettings | LoginSettings | No | Node login information (currently only supports using Password or single KeyIds) |
| HostName | string | No | When reinstalling the system, you can specify the HostName of the modified instance (when the cluster is in HostName mode, this parameter is required, and the rule name is the same as the Create CVM Instance API HostName except for uppercase letters not being supported. |
| SecurityGroupIds | string[] | No | Security group to which the instance belongs. This parameter can be obtained from the `sgId` field returned by DescribeSecurityGroups. If this parameter is not specified, the default security group is bound. (Currently, you can only set a single sgId) |
| NodePool | NodePoolOption | No | Node pool options |
| SkipValidateOptions | string[] | No | Skips the specified verification. Valid values: GlobalRouteCIDRCheck, VpcCniCIDRCheck |
| InstanceAdvancedSettingsOverrides | InstanceAdvancedSettings[] | No | This API is used to customize the configuration of an instance, which corresponds to the "InstanceIds" one-to-one in sequence. If the InstanceAdvancedSettingsOverrides array is passed in, the default parameter "InstanceAdvancedSettings" will be overwritten. If the parameter InstanceAdvancedSettingsOverrides is not passed in, the parameter "InstanceAdvancedSettings" will take effect for each ins… |
| ImageId | string | No | Node image |
Response
Fields are returned inside the Response envelope. Converge Cloud answers HTTP 200 for errors as well as successes, so read Response.Error rather than the status code — and test for the presence of that object, because Code is occasionally the empty string.
| Field | Type | Description |
|---|---|---|
| FailedInstanceIds | string[] | IDs of failed nodes |
| SuccInstanceIds | string[] | IDs of successful nodes |
| TimeoutInstanceIds | string[] | IDs of (successful or failed) nodes that timed out |
| FailedReasons | string[] | Causes of the failure to add a node to a cluster |
| RequestId | string | The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem. |
Success
{
"Response": {
"FailedInstanceIds": …,
"SuccInstanceIds": …,
"RequestId": "…"
}
}Error
{
"Response": {
"Error": { "Code": "…", "Message": "…" },
"RequestId": "…"
}
}Try it
CredentialThe key never leaves this tab — it signs the request here. The signed request goes to /api-relay/tke.
Request bodyvalid JSONPOST tke.api3.convergecloud.com · AddExistedInstances
What failure looks like
Example error responses for this action. Match on Code.
Recorded error 1
{
"Response": {
"RequestId": "c3ededfb-5522-2bd0-c14e-fc9dc3540a27",
"Error": {
"Code": "InternalError",
"Message": "get cluster from platform-api failed, err: clusters.platform.tkestack.io \"cls-00000000\" not found"
}
}
}Recorded error 2
{
"Response": {
"RequestId": "2a625c66-bd6e-2e8c-795a-2d91c3b85375",
"Error": {
"Code": "InternalError",
"Message": "get cluster from platform-api failed, err: clusters.platform.tkestack.io \"cls-00000000\" not found"
}
}
}