Query OS information based on instance IDs in batch
Updated at:2025-10-20
This API enables batch querying of OS information for instances based on their instance IDs.
- The instanceIds parameter is optional; if left out, an empty result will be returned by default.
Request structure
Plain Text
1POST /v{version}/image/os HTTP/1.1
2Host: bcc.bj.baidubce.com
3Authorization: authorization string
4
5{
6 "instanceIds": ["instanceId"]
7}
Request headers
There are no special headers required beyond the common headers.
Request parameters
| Parameter name | Types | Whether required | Parameter location | Description |
|---|---|---|---|---|
| instanceIds | List |
No | Request Body parameters | List of instance IDs |
Response headers
No special headers beyond common headers.
Response parameters
| Parameter name | Types | Description |
|---|---|---|
| osInfo | List<[OsModel](BCC/API Reference/Appendix.md#OsModel)> | List of returned OS information |
Request example
Plain Text
1POST /v2/image/os HTTP/1.1
2Host: bcc.bj.baidubce.com
3ContentType: application/json
4Date: Wed, 01 Mar 2006 12:00:00 GMT
5Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
6{
7 "instanceIds": [
8 "i-ZeVPsPzv",
9 "i-HmGPcF2D",
10 "i-FAlSyeUz"
11 ]
12}
Response example
Plain Text
1HTTP/1.1 200 OK
2x-bce-request-id: 1214cca7-4ad5-451d-9215-71cb844c0a50
3Date: Wed, 03 Dec 2014 06:42:19 GMT
4Content-Type: application/json;charset=UTF-8
5Server: BWS
6"osInfo": [
7 {
8 "instanceId": "i-FAlSyeUz",
9 "osArch": "i386 (32bit)",
10 "osVersion": "14.04.1 LTS",
11 "osName": "Ubuntu",
12 "osType": "linux"
13 },
14 {
15 "instanceId": "i-ZeVPsPzv",
16 "osArch": "i386 (32bit)",
17 "osVersion": "14.04.1 LTS",
18 "osName": "Ubuntu",
19 "osType": "linux"
20 },
21 {
22 "instanceId": "i-HmGPcF2D",
23 "osArch": "i386 (32bit)",
24 "osVersion": "14.04.1 LTS",
25 "osName": "Ubuntu",
26 "osType": "linux"
27 }
28]
