VM Scheduling Policy Interfaces


Create Host Scheduling Group (CreateHostSchedulingRuleGroup)

API Request

URLs
POST zstack/v1/hostSchedulingRuleGroup
Headers
Authorization: OAuth the-session-uuid
Body
{   "params": {     "name": "test",     "description": "test desc",     "zoneUuid": "4e083eaa197835778fa94d9bfcf012d6",     "clusterUuid": "e7127ff00fbb3ed3a9755c37447b7bf8"   },   "systemTags": [],   "userTags": [] } 
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X POST -d '{"params":{"name":"test","description":"test desc","zoneUuid":"4e083eaa197835778fa94d9bfcf012d6","clusterUuid":"e7127ff00fbb3ed3a9755c37447b7bf8"}}' http://localhost:8080/zstack/v1/hostSchedulingRuleGroup
Parameter List
Name Type Location Description Allowed Values Starting Version
name String body (contained in the params structure) Resource name 4.6.0
description (optional) String body (contained in the params structure) Detailed description of the resource 4.6.0
zoneUuid String body (contained in the params structure) Data Center UUID 4.6.0
clusterUuid String body (contained in the params structure) Cluster UUID 4.6.0
resourceUuid (optional) String body (contained in the params structure) Resource UUID 4.6.0
tagUuids (optional) List body (contained in the params structure) Tag UUID list 4.6.0
systemTags (optional) List body System tags 4.6.0
userTags (optional) List body User tags 4.6.0

API Response

Response Example
{   "inventory": {     "name": "test",     "description": "test desc",     "zoneUuid": "1eca7fc3081a3750b55930b194d82991",     "clusterUuid": "e73c4aa3e6a03ee3bb4f325ab3b395b1"   } }
Name Type Description Starting Version
success boolean 4.6.0
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error 4.6.0
inventory AffinityGroupInventory For details, see inventory 4.6.0
#error
Name Type Description Starting Version
code String Error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 4.6.0
description String Brief description of the error 4.6.0
details String Detailed information about the error 4.6.0
elaboration String Reserved field. Default is null 4.6.0
opaque LinkedHashMap Reserved field. Default is null 4.6.0
cause ErrorCode Root error. The source error that caused the current error. This field is null if no root error exists 4.6.0
#inventory
Name Type Description Starting Version
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
zoneUuid String Data Center UUID 4.6.0
clusterUuid String Cluster UUID 4.6.0
createDate Timestamp Creation time 4.6.0
lastOpDate Timestamp Last modification time 4.6.0

SDK Examples

Java SDK
CreateHostSchedulingRuleGroupAction action = new CreateHostSchedulingRuleGroupAction(); action.name = "test"; action.description = "test desc"; action.zoneUuid = "4e083eaa197835778fa94d9bfcf012d6"; action.clusterUuid = "e7127ff00fbb3ed3a9755c37447b7bf8"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; CreateHostSchedulingRuleGroupAction.Result res = action.call();
Python SDK
CreateHostSchedulingRuleGroupAction action = CreateHostSchedulingRuleGroupAction() action.name = "test" action.description = "test desc" action.zoneUuid = "4e083eaa197835778fa94d9bfcf012d6" action.clusterUuid = "e7127ff00fbb3ed3a9755c37447b7bf8" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" CreateHostSchedulingRuleGroupAction.Result res = action.call()

Delete Host Scheduling Group (DeleteHostSchedulingRuleGroup)

API Request

URLs
DELETE zstack/v1/hostSchedulingRuleGroup/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X DELETE http://localhost:8080/zstack/v1/hostSchedulingRuleGroup/8e02276953ab35e2b591505b0f3167c9
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource. Uniquely identifies the resource 4.6.0
systemTags (optional) List body System tags 4.6.0
userTags (optional) List body User tags 4.6.0

API Response

This API returns an empty JSON structure {} on success. On failure, the returned JSON structure contains an error field, for example:
{     "error": {         "code": "SYS.1001",         "description": "A message or a operation timeout",         "details": "Create VM on KVM timeout after 300s"     } }

SDK Examples

Java SDK
DeleteHostSchedulingRuleGroupAction action = new DeleteHostSchedulingRuleGroupAction(); action.uuid = "8e02276953ab35e2b591505b0f3167c9"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; DeleteHostSchedulingRuleGroupAction.Result res = action.call();
Python SDK
DeleteHostSchedulingRuleGroupAction action = DeleteHostSchedulingRuleGroupAction() action.uuid = "8e02276953ab35e2b591505b0f3167c9" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" DeleteHostSchedulingRuleGroupAction.Result res = action.call()

Update Host Scheduling Group (UpdateHostSchedulingRuleGroup)

API Request

URLs
PUT zstack/v1/hostSchedulingRuleGroup/{uuid}
Headers
Authorization: OAuth the-session-uuid
Body
{   "updateHostSchedulingRuleGroup": {     "name": "test",     "description": "desc"   },   "systemTags": [],   "userTags": [] }
Note: The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \ -H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \ -X PUT -d '{"updateHostSchedulingRuleGroup":{"name":"test","description":"desc"}}' http://localhost:8080/zstack/v1/hostSchedulingRuleGroup/7127bed5295f3a3c94d9b3dbc307450d
Parameter List
Name Type Location Description Allowed Values Starting Version
uuid String url UUID of the resource. Uniquely identifies the resource 4.6.0
name (optional) String body (contained in the updateHostSchedulingRuleGroup structure) Resource name 4.6.0
description (optional) String body (contained in the updateHostSchedulingRuleGroup structure) Detailed description of the resource 4.6.0
systemTags (optional) List body System tags 4.6.0
userTags (optional) List body User tags 4.6.0

API Response

Response Example
{   "inventory": {     "uuid": "b96c8635e48435eca42d3cbfca25704f",     "name": "test",     "description": "desc",     "zoneUuid": "afcd30e31ebb38a8b0a2f013fce73f7a",     "clusterUuid": "ae9b2f516fd43913b1d458ebe5f7222d"   } }
Name Type Description Starting Version
success boolean 4.6.0
error ErrorCode Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error 4.6.0
inventory AffinityGroupInventory For details, see inventory 4.6.0
#error
Name Type Description Starting Version
code String Error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001 4.6.0
description String Brief description of the error 4.6.0
details String Detailed information about the error 4.6.0
elaboration String Reserved field. Default is null 4.6.0
opaque LinkedHashMap Reserved field. Default is null 4.6.0
cause ErrorCode Root error. The source error that caused the current error. This field is null if no root error exists 4.6.0
#inventory
Name Type Description Starting Version
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
zoneUuid String Data Center UUID 4.6.0
clusterUuid String Cluster UUID 4.6.0
createDate Timestamp Creation time 4.6.0
lastOpDate Timestamp Last modification time 4.6.0

SDK Examples

Java SDK
UpdateHostSchedulingRuleGroupAction action = new UpdateHostSchedulingRuleGroupAction(); action.uuid = "7127bed5295f3a3c94d9b3dbc307450d"; action.name = "test"; action.description = "desc"; action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"; UpdateHostSchedulingRuleGroupAction.Result res = action.call();
Python SDK
UpdateHostSchedulingRuleGroupAction action = UpdateHostSchedulingRuleGroupAction() action.uuid = "7127bed5295f3a3c94d9b3dbc307450d" action.name = "test" action.description = "desc" action.sessionId = "b86c9016b4f24953a9edefb53ca0678c" UpdateHostSchedulingRuleGroupAction.Result res = action.call()




















Archives

Download Document Archives

Download

Already filled the basic info?Click here.

Enter at least 2 characters.
Cannot be empty.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

An email with a verification code will be sent to you. Make sure the address you provided is valid and correct.

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Download

Not filled the basic info yet? Click here.

Invalid email address or mobile number.
同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
ZStack Training and Certification
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io
Request Trial
Enter at least 2 characters.
Invalid mobile number.
Enter at least 4 characters.
Invalid email address.
Wrong code. Try again. Send Code Resend Code (60s)

同意 不同意

I have read and concur with the Site TermsPrivacy PolicyRules and Conventions on User Management of ZStack Cloud

Email Us

contact@zstack.io

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.

The download link is sent to your email address.

If you don't see it, check your spam folder, subscription folder, or AD folder.
Or click on the URL below. (For Internet Explorer, right-click the URL and save it.)

Thank you for using ZStack products and services.

Submit successfully.

We'll connect soon.

Thank you for using ZStack products and services.