节点迁移
功能介绍
该API用于在指定集群下迁移节点到另一集群。
集群管理的URL格式为:https://Endpoint/uri。其中uri为资源路径,也即API访问的路径。
接口约束
-
仅支持在同一VPC、同一项目下的不同集群间进行迁移。
-
CCE Turbo集群和CCE Standard集群间不支持互迁。
-
DEC集群和非DEC集群间不支持互迁。
-
开启IPv6开关和未开启IPv6开关的集群间不支持互迁。
-
只支持迁移到目标集群的默认节点池内。
-
CCE Turbo集群下弹性云服务器-物理机类型节点不支持迁移。
调用方法
请参见如何调用API。
URI
PUT /api/v3/projects/{project_id}/clusters/{cluster_id}/nodes/operation/migrateto/{target_cluster_id}
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
项目ID,获取方式请参见如何获取接口URI中参数。 |
cluster_id |
是 |
String |
集群ID,获取方式请参见如何获取接口URI中参数。 |
target_cluster_id |
是 |
String |
集群ID,获取方式请参见如何获取接口URI中参数。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
Content-Type |
是 |
String |
消息体的类型(格式) |
X-Auth-Token |
是 |
String |
调用接口的认证方式分为Token和AK/SK两种,如果您使用的Token方式,此参数为必填,请填写Token的值,获取方式请参见获取token。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
apiVersion |
否 |
String |
API版本,固定值“v3”。 |
kind |
否 |
String |
API类型,固定值“MigrateNodesTask”。 |
spec |
是 |
MigrateNodesSpec object |
配置信息 |
status |
否 |
TaskStatus object |
任务状态 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
os |
是 |
String |
操作系统类型,须精确到版本号。 当指定“alpha.cce/NodeImageID”参数时,“os”参数必须和用户自定义镜像的操作系统一致。 |
extendParam |
否 |
MigrateNodeExtendParam object |
迁移节点时的扩展参数 |
login |
是 |
Login object |
节点的登录方式。密钥对和密码登录方式二者必选其一。 |
runtime |
否 |
Runtime object |
容器运行时 |
nodes |
是 |
Array of NodeItem objects |
待操作节点列表,当前最多支持同时迁移200个节点。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
maxPods |
否 |
Integer |
节点最大允许创建的实例数(Pod),该数量包含系统默认实例,取值范围为16~256。 该设置的目的为防止节点因管理过多实例而负载过重,请根据您的业务需要进行设置。 |
DockerLVMConfigOverride |
否 |
String |
Docker数据盘配置项。 待迁移节点的磁盘类型须和创建时一致(即“DockerLVMConfigOverride”参数中“diskType”字段的值须和创建时一致),请确保单次接口调用时批量选择的节点磁盘类型一致。 默认配置示例如下: "DockerLVMConfigOverride":"dockerThinpool=vgpaas/90%VG;kubernetesLV=vgpaas/10%VG;diskType=evs;lvType=linear" 包含如下字段:
|
alpha.cce/preInstall |
否 |
String |
安装前执行脚本。
说明:
输入的值需要经过Base64编码,方法如下: echo -n "待编码内容" | base64 |
alpha.cce/postInstall |
否 |
String |
安装后执行脚本。
说明:
输入的值需要经过Base64编码,方法如下: echo -n "待编码内容" | base64 |
alpha.cce/NodeImageID |
否 |
String |
指定待切换目标操作系统所使用的用户镜像ID。 当指定“alpha.cce/NodeImageID”参数时,“os”参数必须和用户自定义镜像的操作系统一致。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
sshKey |
否 |
String |
选择密钥对方式登录时的密钥对名称。 |
userPassword |
否 |
UserPassword object |
选择密码方式登录时的账号密码信息,之后可通过此账号密码登录节点。 |
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
username |
否 |
String |
登录账号,默认为“root” |
password |
是 |
String |
登录密码,若创建节点通过用户名密码方式,即使用该字段,则响应体中该字段作屏蔽展示。 密码复杂度要求:
|
响应参数
状态码: 200
参数 |
参数类型 |
描述 |
---|---|---|
apiVersion |
String |
API版本,固定值“v3”。 |
kind |
String |
API类型,固定值“MigrateNodesTask”。 |
spec |
MigrateNodesSpec object |
配置信息 |
status |
TaskStatus object |
任务状态 |
参数 |
参数类型 |
描述 |
---|---|---|
os |
String |
操作系统类型,须精确到版本号。 当指定“alpha.cce/NodeImageID”参数时,“os”参数必须和用户自定义镜像的操作系统一致。 |
extendParam |
MigrateNodeExtendParam object |
迁移节点时的扩展参数 |
login |
Login object |
节点的登录方式。密钥对和密码登录方式二者必选其一。 |
runtime |
Runtime object |
容器运行时 |
nodes |
Array of NodeItem objects |
待操作节点列表,当前最多支持同时迁移200个节点。 |
参数 |
参数类型 |
描述 |
---|---|---|
maxPods |
Integer |
节点最大允许创建的实例数(Pod),该数量包含系统默认实例,取值范围为16~256。 该设置的目的为防止节点因管理过多实例而负载过重,请根据您的业务需要进行设置。 |
DockerLVMConfigOverride |
String |
Docker数据盘配置项。 待迁移节点的磁盘类型须和创建时一致(即“DockerLVMConfigOverride”参数中“diskType”字段的值须和创建时一致),请确保单次接口调用时批量选择的节点磁盘类型一致。 默认配置示例如下: "DockerLVMConfigOverride":"dockerThinpool=vgpaas/90%VG;kubernetesLV=vgpaas/10%VG;diskType=evs;lvType=linear" 包含如下字段:
|
alpha.cce/preInstall |
String |
安装前执行脚本。
说明:
输入的值需要经过Base64编码,方法如下: echo -n "待编码内容" | base64 |
alpha.cce/postInstall |
String |
安装后执行脚本。
说明:
输入的值需要经过Base64编码,方法如下: echo -n "待编码内容" | base64 |
alpha.cce/NodeImageID |
String |
指定待切换目标操作系统所使用的用户镜像ID。 当指定“alpha.cce/NodeImageID”参数时,“os”参数必须和用户自定义镜像的操作系统一致。 |
参数 |
参数类型 |
描述 |
---|---|---|
sshKey |
String |
选择密钥对方式登录时的密钥对名称。 |
userPassword |
UserPassword object |
选择密码方式登录时的账号密码信息,之后可通过此账号密码登录节点。 |
参数 |
参数类型 |
描述 |
---|---|---|
username |
String |
登录账号,默认为“root” |
password |
String |
登录密码,若创建节点通过用户名密码方式,即使用该字段,则响应体中该字段作屏蔽展示。 密码复杂度要求:
|
请求示例
-
迁移一个节点到另一个集群中,且节点操作系统为EulerOS 2.5。
PUT /api/v3/projects/{project_id}/clusters/{cluster_id}/nodes/operation/migrateto/{target_cluster_id} { "spec" : { "os" : "EulerOS 2.5", "login" : { "sshKey" : "KeyPair-001" }, "nodes" : [ { "uid" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" }, { "uid" : "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" } ] } }
-
迁移一个节点到另一个集群中,且节点操作系统为EulerOS 2.5,并指定用户镜像ID。
PUT /api/v3/projects/{project_id}/clusters/{cluster_id}/nodes/operation/migrateto/{target_cluster_id} { "spec" : { "os" : "EulerOS 2.5", "extendParam" : { "alpha.cce/NodeImageID" : "cc697ad7-9563-11e8-8ea7-0255ac106311" }, "login" : { "sshKey" : "KeyPair-001" }, "nodes" : [ { "uid" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" }, { "uid" : "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" } ] } }
响应示例
状态码: 200
表示在指定集群下迁移节点至另一集群的作业下发成功。
{ "spec" : { "os" : "EulerOS 2.5", "login" : { "sshKey" : "KeyPair-001" }, "runtime" : { "name" : "docker" }, "nodes" : [ { "uid" : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" }, { "uid" : "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" } ] }, "status" : { "jobID" : "2ec9b78d-9368-46f3-8f29-d1a95622a568" } }
SDK代码示例
SDK代码示例如下。
-
迁移一个节点到另一个集群中,且节点操作系统为EulerOS 2.5。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.cce.v3.region.CceRegion; import com.huaweicloud.sdk.cce.v3.*; import com.huaweicloud.sdk.cce.v3.model.*; import java.util.List; import java.util.ArrayList; public class MigrateNodeSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); CceClient client = CceClient.newBuilder() .withCredential(auth) .withRegion(CceRegion.valueOf("<YOUR REGION>")) .build(); MigrateNodeRequest request = new MigrateNodeRequest(); request.withClusterId("{cluster_id}"); request.withTargetClusterId("{target_cluster_id}"); MigrateNodesTask body = new MigrateNodesTask(); List<NodeItem> listSpecNodes = new ArrayList<>(); listSpecNodes.add( new NodeItem() .withUid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx") ); listSpecNodes.add( new NodeItem() .withUid("yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy") ); Login loginSpec = new Login(); loginSpec.withSshKey("KeyPair-001"); MigrateNodesSpec specbody = new MigrateNodesSpec(); specbody.withOs("EulerOS 2.5") .withLogin(loginSpec) .withNodes(listSpecNodes); body.withSpec(specbody); request.withBody(body); try { MigrateNodeResponse response = client.migrateNode(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
-
迁移一个节点到另一个集群中,且节点操作系统为EulerOS 2.5,并指定用户镜像ID。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.cce.v3.region.CceRegion; import com.huaweicloud.sdk.cce.v3.*; import com.huaweicloud.sdk.cce.v3.model.*; import java.util.List; import java.util.ArrayList; public class MigrateNodeSolution { public static void main(String[] args) { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); String projectId = "{project_id}"; ICredential auth = new BasicCredentials() .withProjectId(projectId) .withAk(ak) .withSk(sk); CceClient client = CceClient.newBuilder() .withCredential(auth) .withRegion(CceRegion.valueOf("<YOUR REGION>")) .build(); MigrateNodeRequest request = new MigrateNodeRequest(); request.withClusterId("{cluster_id}"); request.withTargetClusterId("{target_cluster_id}"); MigrateNodesTask body = new MigrateNodesTask(); List<NodeItem> listSpecNodes = new ArrayList<>(); listSpecNodes.add( new NodeItem() .withUid("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx") ); listSpecNodes.add( new NodeItem() .withUid("yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy") ); Login loginSpec = new Login(); loginSpec.withSshKey("KeyPair-001"); MigrateNodeExtendParam extendParamSpec = new MigrateNodeExtendParam(); extendParamSpec.withAlphaCceNodeImageID("cc697ad7-9563-11e8-8ea7-0255ac106311"); MigrateNodesSpec specbody = new MigrateNodesSpec(); specbody.withOs("EulerOS 2.5") .withExtendParam(extendParamSpec) .withLogin(loginSpec) .withNodes(listSpecNodes); body.withSpec(specbody); request.withBody(body); try { MigrateNodeResponse response = client.migrateNode(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
-
迁移一个节点到另一个集群中,且节点操作系统为EulerOS 2.5。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkcce.v3.region.cce_region import CceRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcce.v3 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = CceClient.new_builder() \ .with_credentials(credentials) \ .with_region(CceRegion.value_of("<YOUR REGION>")) \ .build() try: request = MigrateNodeRequest() request.cluster_id = "{cluster_id}" request.target_cluster_id = "{target_cluster_id}" listNodesSpec = [ NodeItem( uid="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ), NodeItem( uid="yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" ) ] loginSpec = Login( ssh_key="KeyPair-001" ) specbody = MigrateNodesSpec( os="EulerOS 2.5", login=loginSpec, nodes=listNodesSpec ) request.body = MigrateNodesTask( spec=specbody ) response = client.migrate_node(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
-
迁移一个节点到另一个集群中,且节点操作系统为EulerOS 2.5,并指定用户镜像ID。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
# coding: utf-8 import os from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkcce.v3.region.cce_region import CceRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkcce.v3 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.environ["CLOUD_SDK_AK"] sk = os.environ["CLOUD_SDK_SK"] projectId = "{project_id}" credentials = BasicCredentials(ak, sk, projectId) client = CceClient.new_builder() \ .with_credentials(credentials) \ .with_region(CceRegion.value_of("<YOUR REGION>")) \ .build() try: request = MigrateNodeRequest() request.cluster_id = "{cluster_id}" request.target_cluster_id = "{target_cluster_id}" listNodesSpec = [ NodeItem( uid="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" ), NodeItem( uid="yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" ) ] loginSpec = Login( ssh_key="KeyPair-001" ) extendParamSpec = MigrateNodeExtendParam( alpha_cce_node_image_id="cc697ad7-9563-11e8-8ea7-0255ac106311" ) specbody = MigrateNodesSpec( os="EulerOS 2.5", extend_param=extendParamSpec, login=loginSpec, nodes=listNodesSpec ) request.body = MigrateNodesTask( spec=specbody ) response = client.migrate_node(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
-
迁移一个节点到另一个集群中,且节点操作系统为EulerOS 2.5。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" cce "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := cce.NewCceClient( cce.CceClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.MigrateNodeRequest{} request.ClusterId = "{cluster_id}" request.TargetClusterId = "{target_cluster_id}" var listNodesSpec = []model.NodeItem{ { Uid: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", }, { Uid: "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy", }, } sshKeyLogin:= "KeyPair-001" loginSpec := &model.Login{ SshKey: &sshKeyLogin, } specbody := &model.MigrateNodesSpec{ Os: "EulerOS 2.5", Login: loginSpec, Nodes: listNodesSpec, } request.Body = &model.MigrateNodesTask{ Spec: specbody, } response, err := client.MigrateNode(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
-
迁移一个节点到另一个集群中,且节点操作系统为EulerOS 2.5,并指定用户镜像ID。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" cce "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/cce/v3/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") projectId := "{project_id}" auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). WithProjectId(projectId). Build() client := cce.NewCceClient( cce.CceClientBuilder(). WithRegion(region.ValueOf("<YOUR REGION>")). WithCredential(auth). Build()) request := &model.MigrateNodeRequest{} request.ClusterId = "{cluster_id}" request.TargetClusterId = "{target_cluster_id}" var listNodesSpec = []model.NodeItem{ { Uid: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", }, { Uid: "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy", }, } sshKeyLogin:= "KeyPair-001" loginSpec := &model.Login{ SshKey: &sshKeyLogin, } alphaCceNodeImageIDExtendParam:= "cc697ad7-9563-11e8-8ea7-0255ac106311" extendParamSpec := &model.MigrateNodeExtendParam{ AlphaCceNodeImageID: &alphaCceNodeImageIDExtendParam, } specbody := &model.MigrateNodesSpec{ Os: "EulerOS 2.5", ExtendParam: extendParamSpec, Login: loginSpec, Nodes: listNodesSpec, } request.Body = &model.MigrateNodesTask{ Spec: specbody, } response, err := client.MigrateNode(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
更多编程语言的SDK代码示例,请参见API Explorer的代码示例页签,可生成自动对应的SDK代码示例。
状态码
状态码 |
描述 |
---|---|
200 |
表示在指定集群下迁移节点至另一集群的作业下发成功。 |
错误码
请参见错误码。