Document navigation

QueryHostOsCategory

API Request

URLs
GET zstack/v1/hosts/os/category
Headers
Authorization: OAuth the-session-uuid
Curl Example
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

Run the CLI command tool, enter QueryHost and press Tab to view all queryable fields and resources that can be queried across tables.

API Response

Response Example
{
  "inventories": [
    {
      "architecture": "x86_64",
      "osReleaseVersion": "helix Core 7.6.1810",
      "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 succeeded 4.6.21
inventories List See details inventories 4.6.21
error ErrorCode Error code. If not null, the operation failed. If null, the operation succeeded. See details error 4.6.21
#inventories
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the entry 4.6.21
architecture String Host architecture, for example x86_64 4.6.21
osReleaseVersion String Host OS version 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
metadataList List See details metadataList 4.6.21
#metadataList
Name Type Description Starting Version
uuid String Resource UUID, uniquely identifies the entry 4.6.21
categoryUuid String Supported host type entry UUID 4.6.21
managementNodeUuid String Management Node UUID 4.6.21
hypervisor String Hypervisor name, for example qemu-kvm 4.6.21
version String Version number, for example 4.2.0-632.g6a6222b.el7 4.6.21
createDate Timestamp Creation time 4.6.21
lastOpDate Timestamp Last modification time 4.6.21
#error
Name Type Description Starting Version
code String Error code number, globally unique identifier of the error, e.g. SYS.1000, HOST.1001 4.6.21
description String Brief description of the error 4.6.21
details String Detailed error information 4.6.21
elaboration String Reserved field, default is null 4.6.21
opaque LinkedHashMap Reserved field, default is null 4.6.21
cause ErrorCode Root cause, the error that caused the current error. If there is no original error, this field is null 4.6.21

SDK Examples

Java SDK
QueryHostOsCategoryAction action = new QueryHostOsCategoryAction();
action.conditions = asList("architecture=x86_64","osReleaseVersion=\"helix Core 7.6\"");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryHostOsCategoryAction.Result res = action.call();
Python SDK
QueryHostOsCategoryAction action = QueryHostOsCategoryAction()
action.conditions = ["architecture=x86_64","osReleaseVersion=\"helix Core 7.6""]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryHostOsCategoryAction.Result res = action.call()
API Reference | ZStack ZSphere · ZVF | ZStack Resource Center