VM Related Interfaces

Query VM Priority Config

GET/zstack/v1/vm-priority-config
GET/zstack/v1/vm-priority-config/{uuid}

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/vm-priority-config?q=uuid=b095e162c1d9318bb0eaccd649d3c33f
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/vm-priority-config/93521ba5b6203bebb6eb3bdba7fa6f32

Queryable Fields

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

API Response

Response Example

{
  "inventories": [
    {
      "uuid": "0fcf4c7560d63bf58a4c47a5c37c2f1f",
      "level": "Normal",
      "cpuShares": 2,
      "oomScoreAdj": 100
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 0.6
errorErrorCodeError code. If not null, the operation failed. When the operation succeeds, this field is null. For details, see error3.7.0
inventoriesListFor details, see inventories3.7.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier of the error, for example SYS.1000, HOST.10013.7.0
descriptionStringBrief description of the error3.7.0
detailsStringDetailed error information3.7.0
elaborationStringReserved field, defaults to null3.7.0
opaqueLinkedHashMapReserved field, defaults to null3.7.0
causeErrorCodeRoot cause. The error that triggered the current error. If there is no original error, this field is null3.7.0

inventories

NameTypeDescriptionStarting Version
uuidStringResource UUID, uniquely identifies the resource3.7.0
accountUuidStringAccount UUID3.7.0
cpuSharesint 3.7.0
oomScoreAdjint 3.7.0
createDateTimestampCreate time3.7.0
lastOpDateTimestampLast modification time3.7.0
levelVmPriorityLevelFor details, see level3.7.0

level

NameTypeDescriptionStarting Version
NormalVmPriorityLevel 3.7.0
HighVmPriorityLevel 3.7.0

SDK Examples

Java SDK

QueryVmPriorityConfigAction action = new QueryVmPriorityConfigAction();
action.conditions = asList("uuid=97e90d00e03b3529b1c218405cc6346b");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVmPriorityConfigAction.Result res = action.call();

Python SDK

QueryVmPriorityConfigAction action = QueryVmPriorityConfigAction()
action.conditions = ["uuid=c68b427cb1963529aa1d003cd7f1c1af"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVmPriorityConfigAction.Result res = action.call()