实例组操作接口
更新时间:2022-03-02
查询实例组列表
接口描述
查询指定集群的实例组信息
权限说明
请求发起人需要具有合法的AccessKeyID和SecretAccessKey才能发起请求,请参考 鉴权认证。
注意事项
如果请求中没有用户验证信息(即匿名访问),返回403 Forbidden
,错误信息:AccessDenied
。
请求结构
GET /v{version}/cluster/{clusterId}/instanceGroup HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: {utc-date-string}
host: bmr.bj.baidubce.com
connection: keep-alive
accept: */*
content-type: application/json
authorization: {bce-authorization-string}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名 | 参数类型 | 是否必须 | 参数位置 | 参数描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号,当前取值1 |
clusterId | String | 是 | URL参数 | 指定的集群ID |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名 | 参数类型 | 参数描述 |
---|---|---|
instanceGroups | List<InstanceGroup> | 返回的实例组列表 |
请求示例
GET /v1/cluster/0ce4f730-4af2-4f37-8fa2-b14f2f44e50e/instanceGroup HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: 2022-01-26T13:02:00Z
host: bmr.bj.baidubce.com
connection: keep-alive
accept: */*
content-type: application/json
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2022-01-26T13:02:00Z/1800/host;x-bce-date/994014d96b0eb26578e039fa053a4f9003425da4bfedf33f4790882fb4c54903
响应示例
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: 73c4e74c-3101-4a00-bf44-fe246959c05e
Cache-Control: no-cache
Server: BWS
Date: Wed, 26 Jan 2022 13:02:01 GMT
Content-Type: application/json;charset=UTF-8
{
"instanceGroups": [
{
"id": "04ef4f35-2d16-4e5b-9944-bd4003bd8139",
"name": "ngca0712f-master",
"type": "Master",
"spec": "bcc.g3.c4m16",
"cpu": 4,
"memory": 16,
"isSpot": false,
"bidModel": "",
"bidPrice": "",
"cds": [
{
"sizeInGB": 50,
"mediumType": "ssd"
}
],
"diskType": "",
"localDiskSize": 0,
"rootDiskSizeInGB": 40,
"rootDiskMediumType": "ssd",
"requestedInstanceCount": 0,
"totalInstanceCount": 0,
"runningInstanceCount": 1,
"maxCount": 2,
"minCount": 1,
"canExpand": 0,
"canShrink": 0,
"code": "",
"message": ""
},
{
"id": "9fd3f4fe-85cc-459d-8548-214beffaa7f3",
"name": "ng138e063-core",
"type": "Core",
"spec": "bcc.g3.c4m16",
"cpu": 4,
"memory": 16,
"isSpot": false,
"bidModel": "",
"bidPrice": "",
"cds": [
{
"sizeInGB": 50,
"mediumType": "ssd"
}
],
"diskType": "",
"localDiskSize": 0,
"rootDiskSizeInGB": 40,
"rootDiskMediumType": "ssd",
"requestedInstanceCount": 0,
"totalInstanceCount": 0,
"runningInstanceCount": 3,
"maxCount": 200,
"minCount": 2,
"canExpand": 1,
"canShrink": 0,
"state": "Initializing",
"code": "",
"message": ""
}
]
}
修改实例组配置
接口描述
修改指定集群的实例组配置
权限说明
请求发起人需要具有合法的AccessKeyID和SecretAccessKey才能发起请求,请参考 鉴权认证。
注意事项
如果请求中没有用户验证信息(即匿名访问),返回403 Forbidden
,错误信息:AccessDenied
。
请求结构
PUT /v{version}/cluster/{clusterId}/instanceGroup?clientToken={clientToken} HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: {utc-date-string}
host: bmr.bj.baidubce.com
connection: keep-alive
accept: */*
content-type: application/json
authorization: {bce-authorization-string}
{
"instanceGroups": [
{
"id": "cefb0a10-6028-467b-8dd5-d71d3cf74fcb",
"instanceCount": 4
},
{
"id": "0575111f-a702-434c-b463-8991b5fb4552",
"instanceCount": 2
}
]
}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名 | 参数类型 | 是否必须 | 参数位置 | 参数描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API版本号,当前取值1 |
clusterId | String | 是 | URL参数 | 待修改的集群ID,只有状态为RUNNING或WAITING的集群才能进行该操作 |
clientToken | String | 否 | Query参数 | 幂等性Token,是一个长度不超过64位的ASCII字符 |
instanceGroups | List<ModifyInstanceGroupConfig> | 是 | RequestBody参数 | 待修改实例组配置,可省略无须修改的实例组 |
响应头域
除公共头域外,无其它特殊头域。
响应参数
无参数
请求示例
PUT /v1/cluster/f5fa683d-4cf4-46b6-b5ab-bb2c0340c970/instanceGroup?clientToken=bf31b98c-5e41-4838-9830-9be700de5a20 HTTP/1.1
accept-encoding: gzip, deflate
x-bce-date: 2022-01-26T13:02:00Z
host: bmr.bj.baidubce.com
connection: keep-alive
accept: */*
content-type: application/json
authorization: bce-auth-v1/46bd9968a6194b4bbdf0341f2286ccce/2022-01-26T13:02:00Z/1800/host;x-bce-date/994014d96b0eb26578e039fa053a4f9003425da4bfedf33f4790882fb4c54903
{
"instanceGroups": [
{
"id": "cefb0a10-6028-467b-8dd5-d71d3cf74fcb",
"instanceCount": 4
},
{
"id": "0575111f-a702-434c-b463-8991b5fb4552",
"instanceCount": 2
}
]
}
响应示例
HTTP/1.1 204 NO_CONTENT
Transfer-Encoding: chunked
x-bce-request-id: 73c4e74c-3101-4a00-bf44-fe246959c05e
Cache-Control: no-cache
Server: BWS
Date: Wed, 26 Jan 2022 13:02:01 GMT
Content-Type: application/json;charset=UTF-8