CreateSlbInstance
API Request
URLs
POST zstack/v1/load-balancers/slb/instancesHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"name": "SlbInstance",
"slbGroupUuid": "9f4fcda488f9346ca9c8ea9243d6d8e3",
"description": "this is a slb for test"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"SlbInstance","slbGroupUuid":"9f4fcda488f9346ca9c8ea9243d6d8e3","description":"this is a slb for test"}}' http://localhost:8080/zstack/v1/load-balancers/slb/instancesRequest Parameters
| Name | Type | Location | Description | Valid Value | Starting Version |
|---|---|---|---|---|---|
| name | String | body(contained in the params structure) | The name of the SLB group. | 4.0.0 | |
| slbGroupUuid | String | body(contained in the params structure) | The UUID of the SLB group. | 4.0.0 | |
| description | String | body(contained in the params structure) | Optional. The detailed description of the SLB group. | 4.0.0 | |
| zoneUuid | List | body(contained in the params structure) | Optional. The zone UUID | 4.0.0 | |
| clusterUuid | String | body(contained in the params structure) | Optional. The cluster UUID. |
|
4.0.0 |
| hostUuid | String | body(contained in the params structure) | Optional. The host UUID. |
|
4.0.0 |
| resourceUuid | String | body(contained in the params structure) | Optional. The instance UUID. | 4.0.0 | |
| tagUuids | String | 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": {}
}| 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 | SlbVmInstanceInventory | 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 |
|---|---|---|---|
| slbGroupUuid | String | 4.0.0 | |
| publicNetworkUuid | String | 4.0.0 | |
| virtualRouterVips | List | 4.0.0 | |
| applianceVmType | String | 4.0.0 | |
| managementNetworkUuid | String | 4.0.0 | |
| defaultRouteL3NetworkUuid | String | 4.0.0 | |
| status | String | 4.0.0 | |
| agentPort | Integer | 4.0.0 | |
| haStatus | String | 4.0.0 | |
| uuid | String | The UUID of the SLB instance. | 4.0.0 |
| name | String | The name of the SLB instance. | 4.0.0 |
| description | String | The detailed description of the SLB instance. | 4.0.0 |
| zoneUuid | String | The zone UUID. | 4.0.0 |
| clusterUuid | String | The cluster UUID. | 4.0.0 |
| imageUuid | String | The image UUID. | 4.0.0 |
| hostUuid | String | The host UUID. | 4.0.0 |
| lastHostUuid | String | 4.0.0 | |
| instanceOfferingUuid | String | The UUID of the instance offering. | 4.0.0 |
| rootVolumeUuid | String | The UUID of the root volume. | 4.0.0 |
| platform | String | 4.0.0 | |
| defaultL3NetworkUuid | String | 4.0.0 | |
| type | String | 4.0.0 | |
| hypervisorType | String | 4.0.0 | |
| memorySize | Long | 4.0.0 | |
| cpuNum | Integer | 4.0.0 | |
| cpuSpeed | Long | 4.0.0 | |
| allocatorStrategy | String | 4.0.0 | |
| createDate | Timestamp | The time when the SLB instance was created. | 4.0.0 |
| lastOpDate | Timestamp | The time when the SLB instance was last modified. | 4.0.0 |
| state | String | 4.0.0 | |
| vmNics | List | See vmNics. | 4.0.0 |
| allVolumes | List | See allVolumes. | 4.0.0 |
| vmCdRoms | List | See vmCdRoms. | 4.0.0 |
#vmNics
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The NIC UUID. | 4.0.0 |
| vmInstanceUuid | String | The VM instance UUID. | 4.0.0 |
| l3NetworkUuid | String | The L3 network UUID. | 4.0.0 |
| ip | String | The IP address of the NIC. | 4.0.0 |
| mac | String | The MAC address of the NIC. | 4.0.0 |
| hypervisorType | String | The virtualization type. | 4.0.0 |
| netmask | String | The netmask. | 4.0.0 |
| gateway | String | The gateway IP address. | 4.0.0 |
| metaData | String | 4.0.0 | |
| ipVersion | Integer | The IP version. | 4.0.0 |
| deviceId | Integer | The device ID. | 4.0.0 |
| type | String | The NIC type. | 4.0.0 |
| createDate | Timestamp | The time when the NIC was created. | 4.0.0 |
| lastOpDate | Timestamp | The time when the NIC was last modified. | 4.0.0 |
| usedIps | List | See usedIps. | 4.0.0 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The IP address UUID. | 4.0.0 |
| ipRangeUuid | String | The IP range UUID. | 4.0.0 |
| l3NetworkUuid | String | The L3 network UUID. | 4.0.0 |
| ipVersion | Integer | The IP version. | 4.0.0 |
| ip | String | The IP address. | 4.0.0 |
| netmask | String | The netmask. | 4.0.0 |
| gateway | String | The gateway IP address. | 4.0.0 |
| usedFor | String | 4.0.0 | |
| ipInLong | long | 4.0.0 | |
| vmNicUuid | String | The VM NIC UUID. | 4.0.0 |
| createDate | Timestamp | The time when the IP address was used. | 4.0.0 |
| lastOpDate | Timestamp | The time when the was last modified. | 4.0.0 |
#allVolumes
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The volume UUID. | 4.0.0 |
| name | String | The volume name. | 4.0.0 |
| description | String | The detailed description of the volume. | 4.0.0 |
| primaryStorageUuid | String | The primary storage UUID. | 4.0.0 |
| vmInstanceUuid | String | The bare metal instance UUID. | 4.0.0 |
| diskOfferingUuid | String | The volume offering UUID. | 4.0.0 |
| rootImageUuid | String | The root image UUID. | 4.0.0 |
| installPath | String | The installation path of the volume in the primary storage. | 4.0.0 |
| type | String | The type of the volume. | 4.0.0 |
| format | String | The format of the volume. | 4.0.0 |
| size | Long | The size of the volume. | 4.0.0 |
| actualSize | Long | The actual storage space that the volume takes up. | 4.0.0 |
| deviceId | Integer | 4.0.0 | |
| state | String | The state of the volume. | 4.0.0 |
| status | String | The status of the volume. | 4.0.0 |
| createDate | Timestamp | The time when the volume was created. | 4.0.0 |
| lastOpDate | Timestamp | The time when the volume was last modified. | 4.0.0 |
| isShareable | Boolean | Indicates whether the volume is shareable. | 4.0.0 |
| volumeQos | String | The QoS of the volume, for example, 1048576. | 4.0.0 |
#vmCdRoms
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The CD-ROM UUID. | 4.0.0 |
| vmInstanceUuid | String | The VM instance UUID. | 4.0.0 |
| deviceId | Integer | The device ID. | 4.0.0 |
| isoUuid | String | The ISO image UUID. | 4.0.0 |
| isoInstallPath | String | The installation path of the ISO image. | 4.0.0 |
| name | String | The CD-ROM name. | 4.0.0 |
| description | String | The detailed description of the CD-ROM. | 4.0.0 |
| createDate | Timestamp | The time when the CD-ROM was created. | 4.0.0 |
| lastOpDate | Timestamp | The time when the CD-ROM was last modified. | 4.0.0 |
SDK Sample
Java
SDK
CreateSlbInstanceAction action = new CreateSlbInstanceAction();
action.name = "SlbInstance";
action.slbGroupUuid = "9f4fcda488f9346ca9c8ea9243d6d8e3";
action.description = "this is a slb for test";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSlbInstanceAction.Result res = action.call();Python
SDK
CreateSlbInstanceAction action = CreateSlbInstanceAction()
action.name = "SlbInstance"
action.slbGroupUuid = "9f4fcda488f9346ca9c8ea9243d6d8e3"
action.description = "this is a slb for test"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSlbInstanceAction.Result res = action.call()