QueryLoadBalancer
API Request
URLs
GET zstack/v1/load-balancers
GET zstack/v1/load-balancers/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 18a70c9589fa4d93a59a228488e459fb" \
-X GET http://localhost:8080/zstack/v1/load-balancers
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b3fd9ebb07e44e61be3c1f4d24710f9d" \
-X GET http://localhost:8080/zstack/v1/load-balancers/2bc2a3e1855249c6ad436556915253d5
Queryable Fields
You can check all queryable fields and resource names that can be queried across
tables by using zstack-cli, entering
QueryLoadBalancer
, and pressing the Tab key.
API Response
Sample
Response
{
"inventories": [
{
"name": "Test-Lb",
"uuid": "36c2ba1d4a86409693a2de40fa0473ca",
"vipUuid": "8807c418b3b74ee5991006bcc4c670e4"
}
]
}
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 |
#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. | 0.6 |
description | String | The detailed 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 |
#inventories
Name | Type | Description | Starting Version |
---|---|---|---|
name | String | The resource name. | 0.6 |
uuid | String | The resource UUID. | 0.6 |
description | String | The detailed description of the resource. | 0.6 |
state | String | 0.6 | |
vipUuid | String | The VIP UUID. | 0.6 |
createDate | Timestamp | The creation date. | 3.1.0 |
lastOpDate | Timestamp | The last operation date. | 3.1.0 |
listeners | List | See listeners. | 0.6 |
#listeners
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 |
loadBalancerUuid | String | The load balancer UUID. | 0.6 |
instancePort | Integer | 0.6 | |
loadBalancerPort | Integer | 0.6 | |
protocol | String | 0.6 | |
createDate | Timestamp | The creation date. | 0.6 |
lastOpDate | Timestamp | The last operation date. | 0.6 |
vmNicRefs | List | See vmNicRefs. | 0.6 |
certificateRefs | List | See certificateRefs. | 0.6 |
#vmNicRefs
Name | Type | Description | Starting Version |
---|---|---|---|
id | Long | 0.6 | |
listenerUuid | String | 0.6 | |
vmNicUuid | String | The VM NIC UUID. | 0.6 |
status | String | 0.6 | |
createDate | Timestamp | The creation date. | 0.6 |
lastOpDate | Timestamp | The last operation date. | 0.6 |
#certificateRefs
Name | Type | Description | Starting Version |
---|---|---|---|
id | Long | 2.3 | |
listenerUuid | String | 2.3 | |
certificateUuid | String | 2.3 | |
createDate | Timestamp | The creation date. | 2.3 |
lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
Java
SDK
QueryLoadBalancerAction action = new QueryLoadBalancerAction();
action.conditions = asList();
action.sessionId = "d649f3ea966e437db93b2049bef206ca";
QueryLoadBalancerAction.Result res = action.call();
Python
SDK
QueryLoadBalancerAction action = QueryLoadBalancerAction()
action.conditions = []
action.sessionId = "244697b709b0490ab8d8d37e6f94592f"
QueryLoadBalancerAction.Result res = action.call()