QueryHostOsCategory
API Request
URLs
GET zstack/v1/hosts/os/categoryHeaders
Authorization: OAuth the-session-uuidCurl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/hosts/os/category?q=architecture=x86_64&q=osReleaseVersion="helix core 7.6"Queryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryHost, and pressing the Tab key.
API Response
Sample
Response
{
"inventories": [
{
"architecture": "x86_64",
"osReleaseVersion": "helix Core 7.6",
"metadataList": [
{
"managementNodeUuid": "fe5459189a8733ef9b6b8141b84f7071",
"hypervisor": "qemu-kvm",
"version": "4.2.0-632.g6a6222b.el7",
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM"
}
],
"createDate": "Nov 14, 2017 2:20:57 PM",
"lastOpDate": "Nov 14, 2017 2:20:57 PM"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | Whether the query is successful or not. | 4.6.21 |
| inventories | List | See inventories. | 4.6.21 |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.6.21 |
#inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.6.21 |
| architecture | String | The host architecture, such as x86_64. | 4.6.21 |
| osReleaseVersion | String | The host operation system version. | 4.6.21 |
| createDate | Timestamp | The creation date. | 4.6.21 |
| lastOpDate | Timestamp | The last operation date. | 4.6.21 |
| metadataList | List | See metadataList | 4.6.21 |
#metadataList
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.6.21 |
| categoryUuid | String | The UUID of the supported host category. | 4.6.21 |
| managementNodeUuid | String | The management node UUID. | 4.6.21 |
| hypervisor | String | The hypervisor name, such as qemu-kvm. | 4.6.21 |
| version | String | The version number, such as 4.2.0-632.g6a6222b.el7. | 4.6.21 |
| createDate | Timestamp | The creation date. | 4.6.21 |
| lastOpDate | Timestamp | The last operation date. | 4.6.21 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 4.6.21 |
| description | String | The brief description of the error. | 4.6.21 |
| details | String | The details about the error. | 4.6.21 |
| elaboration | String | The reserved field. Default value: null. | 4.6.21 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.6.21 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.6.21 |
SDK Sample
Java
SDK
QueryHostOsCategoryAction action = new QueryHostOsCategoryAction();
action.conditions = asList("architecture=x86_64","osReleaseVersion=\"helix Core 7.6.1810\"");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryHostOsCategoryAction.Result res = action.call();Python
SDK
QueryHostOsCategoryAction action = QueryHostOsCategoryAction()
action.conditions = ["architecture=x86_64","osReleaseVersion=\"helix Core 7.6.1810\""]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryHostOsCategoryAction.Result res = action.call()