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

FieldTypeRequiredDescription
ClusterIdstringYesCluster ID
InstanceIdsstring[]YesInstance list. Spot instance is not supported.
InstanceAdvancedSettingsInstanceAdvancedSettingsNoDetailed information of the instance
EnhancedServiceEnhancedServiceNoEnhanced 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.
LoginSettingsLoginSettingsNoNode login information (currently only supports using Password or single KeyIds)
HostNamestringNoWhen 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.
SecurityGroupIdsstring[]NoSecurity 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)
NodePoolNodePoolOptionNoNode pool options
SkipValidateOptionsstring[]NoSkips the specified verification. Valid values: GlobalRouteCIDRCheck, VpcCniCIDRCheck
InstanceAdvancedSettingsOverridesInstanceAdvancedSettings[]NoThis 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…
ImageIdstringNoNode 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.

FieldTypeDescription
FailedInstanceIdsstring[]IDs of failed nodes
SuccInstanceIdsstring[]IDs of successful nodes
TimeoutInstanceIdsstring[]IDs of (successful or failed) nodes that timed out
FailedReasonsstring[]Causes of the failure to add a node to a cluster
RequestIdstringThe 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"
    }
  }
}