POST zstack/v1/instance-offerings
Authorization: OAuth the-session-uuid
{
"params": {
"name": "instanceOffering",
"cpuNum": 2.0,
"memorySize": 2097152.0,
"sortKey": 0.0,
"type": "UserVm"
},
"systemTags": [],
"userTags": []
}
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"instanceOffering","cpuNum":2.0,"memorySize":2097152.0,"sortKey":0.0,"type":"UserVm"}}' \
http://localhost:8080/zstack/v1/instance-offerings
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
name | String | body (contained in the params structure) | The resource name. | 0.6 | |
description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 0.6 | |
cpuNum | int | body (contained in the params structure) | The CPU count. | 0.6 | |
memorySize | long | body (contained in the params structure) | The memory size. Unit: byte. | 0.6 | |
allocatorStrategy | String | body (contained in the params structure) | Optional. The allocator strategy. |
| 0.6 |
sortKey | int | body (contained in the params structure) | Optional. The sort key. | 0.6 | |
type | String | body (contained in the params structure) | Optional. The type. | 0.6 | |
resourceUuid | String | body (contained in the params structure) | Optional. The resource UUID. | 0.6 | |
systemTags | List | body | Optional. The system tags. | 0.6 | |
userTags | List | body | Optional. The user tags. | 0.6 |
pciRomUuid::UUID
. Here, the UUID is the UUID of the PCI device firmware.pciRomUuid::5fd71606d5af451d981413f35367a8d6
instanceOfferingUserConfig::xxx
. Here, xxx must be a JSON string.{
"inventory": {
"uuid": "d04e02a97d6c4ad0b0acee2a2f6c7084",
"name": "instanceOffering1",
"cpuNum": 2.0,
"cpuSpeed": 1.0,
"type": "UserVm",
"allocatorStrategy": "Mevoco",
"createDate": "Jun 7, 2017 9:20:40 PM",
"lastOpDate": "Jun 7, 2017 9:20:40 PM",
"state": "Enabled"
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
inventory | InstanceOfferingInventory | See inventory. | 0.6 |
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
description | String | The brief description of the error. | 0.6 |
details | String | The details about the error. | 0.6 |
elaboration | String | The reserved field. Default value: null. | 0.6 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 0.6 |
name | String | The resource name. | 0.6 |
description | String | The detailed description of the resource. | 0.6 |
cpuNum | Integer | The CPU count. | 0.6 |
cpuSpeed | Integer | The CPU speed. | 0.6 |
memorySize | Long | The memory size. | 0.6 |
type | String | The type. | 0.6 |
allocatorStrategy | String | The allocator strategy. | 0.6 |
sortKey | Integer | 0.6 | |
createDate | Timestamp | The creation date. | 0.6 |
lastOpDate | Timestamp | The last operation date. | 0.6 |
state | String | The state, including Enabled and Disabled. | 0.6 |
CreateInstanceOfferingAction action = new CreateInstanceOfferingAction();
action.name = "instanceOffering";
action.cpuNum = 2.0;
action.memorySize = 2097152.0;
action.sortKey = 0.0;
action.type = "UserVm";
action.sessionId = "1567ec4024724d2ea60eba29b957158c";
CreateInstanceOfferingAction.Result res = action.call();
Python SDK
CreateInstanceOfferingAction action = CreateInstanceOfferingAction()
action.name = "instanceOffering"
action.cpuNum = 2.0
action.memorySize = 2097152.0
action.sortKey = 0.0
action.type = "UserVm"
action.sessionId = "427dd2d091a54a0999e7e31eac07fc83"
CreateInstanceOfferingAction.Result res = action.call()
DELETE zstack/v1/instance-offerings/{uuid}?deleteMode={deleteMode}
Authorization: OAuth the-session-uuid
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth cd94b78dc89842c19ea248ddb04816c0" \
-X DELETE http://localhost:8080/zstack/v1/instance-offerings/d4061032ef3940b990ba671acd1221fc?deleteMode=Permissive
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The resource UUID. | 0.6 | |
deleteMode | String | body | Optional. The delete mode. | 0.6 | |
systemTags | List | body | Optional. The system tags. | 0.6 | |
userTags | List | body | Optional. The user tags. | 0.6 |
When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}
DeleteInstanceOfferingAction action = new DeleteInstanceOfferingAction();
action.uuid = "07ce817b8d9d4f629c2bd65daae9b7bb";
action.deleteMode = "Permissive";
action.sessionId = "fd2aa30babca411780c7df97d3ae6f9f";
DeleteInstanceOfferingAction.Result res = action.call();
DeleteInstanceOfferingAction action = DeleteInstanceOfferingAction()
action.uuid = "694e24b4a64d4b45936a9bbcf878078b"
action.deleteMode = "Permissive"
action.sessionId = "a13ac6edf7f546e48c4dbfea66429610"
DeleteInstanceOfferingAction.Result res = action.call()
GET zstack/v1/instance-offerings
GET zstack/v1/instance-offerings/{uuid}
Authorization: OAuth the-session-uuid
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth d4743a8bc4eb4dd7a827c58e20437e85" \
-X GET http://localhost:8080/zstack/v1/instance-offerings?q=uuid=3695f87b54594284b9ce542b2b653fb7
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth e053145ce7d74cad8686d9b2a91e2754" \
-X GET http://localhost:8080/zstack/v1/instance-offerings/b1c967830a5f4b198b291d7f22cc8a2f
Queryable Fields
You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryInstanceOffering
, and pressing the Tab key.
Sample Response
{
"inventories": [
{
"uuid": "4f7e7eff5bb04f7cacc33a18006a0c72",
"name": "instanceOffering1",
"cpuNum": 2.0,
"cpuSpeed": 1.0,
"type": "UserVm",
"allocatorStrategy": "Mevoco",
"createDate": "Jun 7, 2017 9:20:13 PM",
"lastOpDate": "Jun 7, 2017 9:20:13 PM",
"state": "Enabled"
}
]
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 0.6 |
inventories | List | See inventories. | 0.6 |
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 0.6 |
description | String | The brief description of the error. | 0.6 |
details | String | The details about the error. | 0.6 |
elaboration | String | The reserved field. Default value: null. | 0.6 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 0.6 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 0.6 |
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The resource UUID. | 0.6 |
name | String | The resource name. | 0.6 |
description | String | The detailed description of the resource. | 0.6 |
cpuNum | Integer | The CPU count. | 0.6 |
cpuSpeed | Integer | The CPU speed. | 0.6 |
memorySize | Long | The memory size. | 0.6 |
type | String | The type. | 0.6 |
allocatorStrategy | String | The allocator strategy. | 0.6 |
sortKey | Integer | 0.6 | |
createDate | Timestamp | The creation date. | 0.6 |
lastOpDate | Timestamp | The last operation date. | 0.6 |
state | String | The state, including Enabled and Disabled. | 0.6 |
QueryInstanceOfferingAction action = new QueryInstanceOfferingAction();
action.conditions = asList("uuid=8c77205cdc114a9090bc5d978b9d5285");
action.sessionId = "7d91852598ca41ca904539b34396c2ec";
QueryInstanceOfferingAction.Result res = action.call();
QueryInstanceOfferingAction action = QueryInstanceOfferingAction()
action.conditions = ["uuid=6539c13e7a8843b7860ebc53c3f7e892"]
action.sessionId = "8700ab8ae22e48fb81a793b9a51e970a"
QueryInstanceOfferingAction.Result res = action.call()
Email Us
contact@zstack.ioEmail Us
contact@zstack.ioThe 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.Thank you for using ZStack products and services.
Submit successfully.
We'll connect soon.Thank you for choosing ZStack products and services.