云服务器内容精选

  • 请求示例 创建节点池。 POST https://{endpoint}/v2/{project_id}/pools/{pool_name}/nodepools { "kind" : "NodePool", "apiVersion" : "v2", "metadata" : { "name" : "nodepool-1", "annotations" : { } }, "spec" : { "resources" : { "nodePool" : "nodepool-1", "flavor" : "modelarts.vm.2u4g.dcc", "count" : 1, "maxCount" : 1, "network" : { "vpc" : "277e9abc-0e6b-431a-9232-cfd25d5fc566", "subnet" : "03796378-c356-4c14-826b-e4913aa9c8b9", "securityGroups" : [ "0a15b48d-06f1-41e4-b782-ade90087bf59" ] } } } }
  • 响应示例 状态码: 200 OK。 { "kind" : "NodePool", "apiVersion" : "v2", "metadata" : { "name" : "nodepool-1", "annotations" : { } }, "spec" : { "resources" : { "nodePool" : "nodepool-1", "flavor" : "modelarts.vm.2u4g.dcc", "count" : 1, "maxCount" : 1, "network" : { "vpc" : "277e9abc-0e6b-431a-9232-cfd25d5fc566", "subnet" : "03796378-c356-4c14-826b-e4913aa9c8b9", "securityGroups" : [ "0a15b48d-06f1-41e4-b782-ade90087bf59" ] } } } } 状态码: 400 Bad request { "error_code" : "ModelArts.50004000", "error_msg" : "Bad request." }
  • 响应示例 状态码: 200 表示获取指定节点池成功。 { "kind" : "NodePool", "apiVersion" : "v3", "metadata" : { "name" : "lc-it-nodepool-79796", "uid" : "99addaa2-69eb-11ea-a592-0255ac1001bb" }, "spec" : { "type" : "vm", "nodeTemplate" : { "flavor" : "s6.large.2", "az" : "******", "os" : "EulerOS 2.5", "login" : { "sshKey" : "KeyPair-001" }, "rootVolume" : { "volumetype" : "SAS", "size" : 40 }, "dataVolumes" : [ { "volumetype" : "SAS", "size" : 100, "extendParam" : { "useType" : "docker" } } ], "publicIP" : { "eip" : { "bandwidth" : { } } }, "nodeNicSpec" : { "primaryNic" : { "subnetId" : "7e767d10-7548-4df5-ad72-aeac1d08bd8a" } }, "billingMode" : 0, "extendParam" : { "maxPods" : 110 }, "k8sTags" : { "cce.cloud.com/cce-nodepool" : "lc-it-nodepool-79796" } }, "autoscaling" : { }, "nodeManagement" : { } }, "status" : { "phase" : "Deleting", "jobId" : "3281fa02-69ee-11ea-a592-0255ac1001bb" }}
  • URI GET /api/v3/projects/{project_id}/clusters/{cluster_id}/nodepools/{nodepool_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 项目ID,获取方式请参见如何获取接口URI中参数。 cluster_id 是 String 集群ID,获取方式请参见如何获取接口URI中参数。 nodepool_id 是 String 节点池ID