Query Host OS Category

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"
    }
  ]
}
NameTypeDescriptionStarting Version
successbooleanWhether the query succeeded4.6.21
inventoriesListSee details inventories4.6.21
errorErrorCodeError code. If not null, the operation failed. If null, the operation succeeded. See details error4.6.21

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the entry4.6.21
architectureStringHost architecture, for example x86_644.6.21
osReleaseVersionStringHost OS version4.6.21
createDateTimestampCreation time4.6.21
lastOpDateTimestampLast modification time4.6.21
metadataListListSee details metadataList4.6.21

metadataList

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the entry4.6.21
categoryUuidStringSupported host type entry UUID4.6.21
managementNodeUuidStringManagement Node UUID4.6.21
hypervisorStringHypervisor name, for example qemu-kvm4.6.21
versionStringVersion number, for example 4.2.0-632.g6a6222b.el74.6.21
createDateTimestampCreation time4.6.21
lastOpDateTimestampLast modification time4.6.21

error

NameTypeDescriptionStarting Version
codeStringError code number, globally unique identifier of the error, e.g. SYS.1000, HOST.10014.6.21
descriptionStringBrief description of the error4.6.21
detailsStringDetailed error information4.6.21
elaborationStringReserved field, default is null4.6.21
opaqueLinkedHashMapReserved field, default is null4.6.21
causeErrorCodeRoot cause, the error that caused the current error. If there is no original error, this field is null4.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()