Query VM Scheduling Policy
Headers
Authorization: OAuth the-session-uuidCurl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/query/vm/schedulingRule?q=uuid=2964e2f366e73491b858ca2da4052624Queryable Fields
Run the CLI tool, enter QueryVmSchedulingRule and press Tab to view all queryable fields and cross-table queryable resource names.
API Response
Response Example
{
"inventories": [
{
"rule": "rule",
"mode": "mode",
"uuid": "ef5e45f916b03e7cae291e3134c3eaa1",
"name": "test",
"description": "description"
}
]
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.7.0 | |
| inventories | List | For details, see inventories | 4.7.0 |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 4.7.0 |
inventories
| Name | Type | Description | Starting Version |
|---|---|---|---|
| rule | String | Rule | 4.6.0 |
| mode | String | Execution mode | 4.6.0 |
| uuid | String | UUID of the resource. Uniquely identifies the resource | 4.6.0 |
| name | String | Resource name | 4.6.0 |
| description | String | Detailed description of the resource | 4.6.0 |
| policy | String | 4.6.0 | |
| version | String | 4.6.0 | |
| type | String | 4.6.0 | |
| appliance | String | 4.6.0 | |
| zoneUuid | String | Data Center UUID | 4.6.0 |
| state | String | 4.6.0 | |
| createDate | Timestamp | Creation time | 4.6.0 |
| lastOpDate | Timestamp | Last modification time | 4.6.0 |
| usages | List | For details, see usages | 4.6.0 |
usages
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | UUID of the resource. Uniquely identifies the resource | 2.2 |
| affinityGroupUuid | String | 2.2 | |
| resourceUuid | String | 2.2 | |
| resourceType | String | 2.2 | |
| createDate | Timestamp | Creation time | 2.2 |
| lastOpDate | Timestamp | Last modification time | 2.2 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. Default is null | 0.6 |
| opaque | LinkedHashMap | Reserved field. Default is null | 0.6 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists | 0.6 |
SDK Examples
Java SDK
QueryVmSchedulingRuleAction action = new QueryVmSchedulingRuleAction();
action.conditions = asList("uuid=8a051adee823307e82d355b6385b589d");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryVmSchedulingRuleAction.Result res = action.call();Python SDK
QueryVmSchedulingRuleAction action = QueryVmSchedulingRuleAction()
action.conditions = ["uuid=39b75b6de9113e4f9915a024ebd2f05c"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryVmSchedulingRuleAction.Result res = action.call()