CreateSlbOffering
API Request
URLs
POST zstack/v1/instance-offerings/slb
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"zoneUuid": "bdbae55ce73b3e2ab8a4ae3a6df0b287",
"managementNetworkUuid": "7661f1f6d5a63d6eb3b9c3890ab3f9bb",
"imageUuid": "2bae0841f4c63f128efcf66d095d73b0",
"name": "SLB-Offering",
"cpuNum": 2.0,
"memorySize": 1024.0,
"sortKey": 0.0,
"type": "SLB"
},
"systemTags": [],
"userTags": []
}

Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"zoneUuid":"bdbae55ce73b3e2ab8a4ae3a6df0b287","managementNetworkUuid":"7661f1f6d5a63d6eb3b9c3890ab3f9bb","imageUuid":"2bae0841f4c63f128efcf66d095d73b0","name":"SLB-Offering","cpuNum":2.0,"memorySize":1024.0,"sortKey":0.0,"type":"SLB"}}' http://localhost:8080/zstack/v1/instance-offerings/slb
Request Parameters
Name | Type | Location | Description | Valid Value | Starting Version |
---|---|---|---|---|---|
zoneUuid | String | body(contained in the params structure) | The zone UUID. | 4.0.0 | |
managementNetworkUuid | String | body(contained in the params structure) | The management network UUID. | 4.0.0 | |
imageUuid | String | body(contained in the params structure) | The image UUID. | 4.0.0 | |
name | String | body(contained in the params structure) | The name of the SLB offering. | 4.0.0 | |
description | String | body(contained in the params structure) | Optional. The detailed description of the SLB offering. | 4.0.0 | |
cpuNum | int | body(contained in the params structure) | 4.0.0 | ||
memorySize | long | body(contained in the params structure) | 4.0.0 | ||
allocatorStrategy | String | body(contained in the params structure) | Optional. | 4.0.0 | |
sortKey | int | body(contained in the params structure) | Optional. | 4.0.0 | |
type | String | body(contained in the params structure) | Optional. | 4.0.0 | |
resourceUuid | String | body(contained in the params structure) | Optional. The UUID of the SLB offering. | 4.0.0 | |
tagUuids | List | body(contained in the params structure) | Optional. The tag UUIDs. | 4.0.0 | |
systemTags | List | body | Optional. The system tags. | 4.0.0 | |
userTags | List | body | Optional. The user tags. | 4.0.0 |
API Response
Sample Response
{
"inventory": {
"uuid": "3b0af4671cc93f619ef326a3c99d825c",
"name": "instanceOffering1",
"cpuNum": 2.0,
"cpuSpeed": 1.0,
"type": "UserVm",
"allocatorStrategy": "Mevoco",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 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. | 4.0.0 |
inventory | InstanceOfferingInventory | See inventory. | 4.0.0 |
#error
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. | 4.0.0 |
description | String | The brief description of the error. | 4.0.0 |
details | String | The details about the error. | 4.0.0 |
elaboration | String | The reserved field. Default value: null. | 4.0.0 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 4.0.0 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.0.0 |
#inventory
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The UUID of the instance offering. | 4.0.0 |
name | String | The name of the instance offering. | 4.0.0 |
description | String | The detailed description of the instance offering. | 4.0.0 |
cpuNum | Integer | The number of CPU cores. | 4.0.0 |
cpuSpeed | Integer | The processing speed of the CPU. | 4.0.0 |
memorySize | Long | The memory size. | 4.0.0 |
type | String | The type of the instance offering. | 4.0.0 |
allocatorStrategy | String | The allocation policy. | 4.0.0 |
sortKey | Integer | 4.0.0 | |
createDate | Timestamp | The time when the instance offering was created. | 4.0.0 |
lastOpDate | Timestamp | The time when the instance offering was last modified. | 4.0.0 |
state | String | The state of the instance offering. | 4.0.0 |
SDK Sample
Java
SDK
CreateSlbOfferingAction action = new CreateSlbOfferingAction();
action.zoneUuid = "bdbae55ce73b3e2ab8a4ae3a6df0b287";
action.managementNetworkUuid = "7661f1f6d5a63d6eb3b9c3890ab3f9bb";
action.imageUuid = "2bae0841f4c63f128efcf66d095d73b0";
action.name = "SLB-Offering";
action.cpuNum = 2.0;
action.memorySize = 1024.0;
action.sortKey = 0.0;
action.type = "SLB";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSlbOfferingAction.Result res = action.call();
Python
SDK
CreateSlbOfferingAction action = CreateSlbOfferingAction()
action.zoneUuid = "bdbae55ce73b3e2ab8a4ae3a6df0b287"
action.managementNetworkUuid = "7661f1f6d5a63d6eb3b9c3890ab3f9bb"
action.imageUuid = "2bae0841f4c63f128efcf66d095d73b0"
action.name = "SLB-Offering"
action.cpuNum = 2.0
action.memorySize = 1024.0
action.sortKey = 0.0
action.type = "SLB"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSlbOfferingAction.Result res = action.call()