AddServerGroupToLoadBalancerListener
API Request
URLs
POST zstack/v1/load-balancers/listeners/{listenerUuid}/servergroupsHeaders
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": {
"serverGroupUuid": "05a078a03cad32a6a4c5c05f418eb27a"
},
"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":{"serverGroupUuid":"05a078a03cad32a6a4c5c05f418eb27a"}}' http://localhost:8080/zstack/v1/load-balancers/listeners/cb64a1d37cae35449ca3f9813150f073/servergroupsRequest Parameters
| Name | Type | Location | Description | Valid Value | Starting Version |
|---|---|---|---|---|---|
| serverGroupUuid | String | body(contained in the params structure) | The UUID of the server group for load balancing. | 4.0.0 | |
| listenerUuid | String | url | The UUID of the listener. | 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": "2bdca7f6bea932cd8373468d971ef61f",
"name": "Test-Listener",
"loadBalancerUuid": "32a8cf1442b43724bef1aa2f94aa97e4",
"instancePort": 80.0,
"loadBalancerPort": 80.0,
"protocol": "http"
}
}| 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 | LoadBalancerListenerInventory | 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 listener UUID. | 4.0.0 |
| name | String | The name of the listener. | 4.0.0 |
| description | String | The detailed description of the listener. | 4.0.0 |
| loadBalancerUuid | String | The load balancer UUID. | 4.0.0 |
| instancePort | Integer | 4.0.0 | |
| loadBalancerPort | Integer | 4.0.0 | |
| protocol | String | 4.0.0 | |
| serverGroupUuid | String | 4.0.0 | |
| createDate | Timestamp | The time when the listener was created. | 4.0.0 |
| lastOpDate | Timestamp | The time when the listener was last modified. | 4.0.0 |
| vmNicRefs | List | See vmNicRefs. | 4.0.0 |
| aclRefs | List | See alcRefs. | 4.0.0 |
| certificateRefs | List | See certificateRefs. | 4.0.0 |
| serverGroupRefs | List | See serverGroupRefs. | 4.0.0 |
#vmNicRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | Long | 4.0.0 | |
| listenerUuid | String | 4.0.0 | |
| vmNicUuid | String | The VM NIC UUID. | 4.0.0 |
| status | String | 4.0.0 | |
| createDate | Timestamp | The time when the NIC was added to the VM instance. | 4.0.0 |
| lastOpDate | Timestamp | The time when the NIC was last modified. | 4.0.0 |
#alcRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | Long | The record ID. | 4.0.0 |
| listenerUuid | String | The listener UUID. | 4.0.0 |
| aclUuid | String | The UUID of the access control list (ACL). | 4.0.0 |
| type | String | The type of the ACL. | 4.0.0 |
| createDate | Timestamp | The time when the ACL was created. | 4.0.0 |
| lastOpDate | Timestamp | The time when the ACL was last modified. | 4.0.0 |
#certificateRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | Long | 4.0.0 | |
| listenerUuid | String | 4.0.0 | |
| certificateUuid | String | 4.0.0 | |
| createDate | Timestamp | The time when the certificate was created. | 4.0.0 |
| lastOpDate | Timestamp | The time when the certificate was last modified. | 4.0.0 |
#serverGroupRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| id | long | 4.0.0 | |
| listenerUuid | String | 4.0.0 | |
| serverGroupUuid | String | 4.0.0 | |
| createDate | Timestamp | The time when the server group was created. | 4.0.0 |
| lastOpDate | Timestamp | The time when the server group was last modified. | 4.0.0 |
SDK Sample
Java
SDK
AddServerGroupToLoadBalancerListenerAction action = new AddServerGroupToLoadBalancerListenerAction();
action.serverGroupUuid = "05a078a03cad32a6a4c5c05f418eb27a";
action.listenerUuid = "cb64a1d37cae35449ca3f9813150f073";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddServerGroupToLoadBalancerListenerAction.Result res = action.call();Python
SDK
AddServerGroupToLoadBalancerListenerAction action = AddServerGroupToLoadBalancerListenerAction()
action.serverGroupUuid = "05a078a03cad32a6a4c5c05f418eb27a"
action.listenerUuid = "cb64a1d37cae35449ca3f9813150f073"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddServerGroupToLoadBalancerListenerAction.Result res = action.call()