实例操作接口
更新时间:2022-03-02
查询实例列表
接口描述
查询指定集群和实例组的实例
权限说明
请求发起人需要具有合法的AccessKeyID和SecretAccessKey才能发起请求,请参考 鉴权认证。
注意事项
如果请求中没有用户验证信息(即匿名访问),返回403 Forbidden
,错误信息:AccessDenied
。
请求结构
GET /v{version}/cluster/{clusterId}/instanceGroup/{instanceGroupId}/instance 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 |
instanceGroupId | String | 是 | URL参数 | 指定的实例组ID |
响应头域
除公共头域外,无其它特殊头域。
响应参数
参数名 | 参数类型 | 参数描述 |
---|---|---|
instances | List<Instance> | 返回的实例列表 |
请求示例
GET /v1/cluster/0ce4f730-4af2-4f37-8fa2-b14f2f44e50e/instanceGroup/dabc21c6-41f8-4b23-98f2-3415e5886a5f/instance 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/46bd9968a6194b4bbdf0341f2286
响应示例
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
{
"instances": [
{
"id": "0413bbc7-55c5-4567-46ca-5eaa84e1700d",
"bccInstanceId": "i-SrbDLXLH",
"instanceName": "bmr-core-111ca89-1",
"status": {
"state": "Stopped",
"code": "",
"message": "",
"creationDateTime": "2022-01-24T11:20:52Z",
"endDateTime": "0001-01-01T00:00:00Z"
},
"privateDnsName": "",
"privateIpAddress": "172.18.0.15",
"publicDnsName": "",
"publicIpAddress": "",
"sshPort": 22
},
{
"id": "8402adb7-3f96-49ab-5573-a8a8fc21f8e7",
"bccInstanceId": "i-kmeHJ4tX",
"instanceName": "bmr-core-111ca89-2",
"status": {
"state": "Stopped",
"code": "",
"message": "",
"creationDateTime": "2022-01-24T11:20:52Z",
"endDateTime": "0001-01-01T00:00:00Z"
},
"privateDnsName": "",
"privateIpAddress": "172.18.0.14",
"publicDnsName": "",
"publicIpAddress": "",
"sshPort": 22
}
]
}