You can call the EdgeClusterAddEdgeMachine operation to add a cloud-native box to an edge Kubernetes cluster.

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 syntax

POST /clusters/[clusterid]/attachedgemachine/[edge_machineid] HTTP/1.1
Content-Type:application/json

{
  "options" : "String",
  "expired" : int,
  "nodepool_id" : "String"
}

Request parameters

Table 1. Request path parameters
Parameter Type Required Example Description
clusterid String Yes c35607f52179f4472a0d9723e7595****

The ID of the cluster to which you want to add a cloud-native box.

edge_machineid String Yes edge_machineid

The ID of the cloud-native box that you want to add.

Table 2. Request body parameters
Parameter Type Required Example Description
options String No "{\"enableIptables\":true,\"quiet\":true,\"manageRuntime\":true,\"allowedClusterAddons\":[\"kube-proxy\",\"flannel\",\"coredns\"]}"

Options that you want to configure.

expired Long No 1024

The timeout period.

nodepool_id String Yes c26607f52179f4472a0d9723e7595****

The ID of the node pool.

Response syntax

POST   HTTP/1.1
<Common request headers>
Content-type: application/json
{
   "request_id": "string",
   "edge_machine_id": "string"
}

Response parameters

Table 3. Response body parameters
Parameter Type Example Description
request_id String 0adf3a23-6841-41e8-9f55-7b290216c980

The ID of the request.

edge_machine_id String 0f4bf70a-caff-4b26-a679-fb0188a1****

The ID of the cloud-native box.

Sample requests

Submit the following sample request to add a cloud-native box to an edge Kubernetes cluster:

POST /clusters/[clusterid]/attachedgemachine/[edge_machineid] HTTP/1.1
Host:cs.aliyuncs.com
Content-Type:application/json

{
  "options" : "\"{\\\"enableIptables\\\":true,\\\"quiet\\\":true,\\\"manageRuntime\\\":true,\\\"allowedClusterAddons\\\":[\\\"kube-proxy\\\",\\\"flannel\\\",\\\"coredns\\\"]}\"",
  "expired" : 1024,
  "nodepool_id" : "c26607f52179f4472a0d9723e7595****"
}

Sample success responses

XML format

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

<EdgeClusterAddEdgeMachineResponse>
    <request_id>0adf3a23-6841-41e8-9f55-7b290216c980</request_id>
    <edge_machine_id>0f4bf70a-caff-4b26-a679-fb0188a1****</edge_machine_id>
</EdgeClusterAddEdgeMachineResponse>

JSON format

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

{
  "request_id" : "0adf3a23-6841-41e8-9f55-7b290216c980",
  "edge_machine_id" : "0f4bf70a-caff-4b26-a679-fb0188a1****"
}

Error codes

For a list of error codes, visit the API Error Center.