Document navigation

Load Balancing Operations

CreateLoadBalancer

API Request

URLs
POST zstack/v1/load-balancers
Headers
Authorization: OAuth the-session-uuid
Body
{
"params": {
"name": "Test-Lb",
"vipUuid": "59a98484f6fe43b9af1d782f725f40ac"
  },
"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 855586410b7b4c0cba21bfd5ed2df4fb" \
-X POST -d '{"params":{"name":"Test-Lb","vipUuid":"d7720f0981853e91b37678e4acb1d4f0"}}' http://localhost:8080/zstack/v1/load-balancers
Request Parameters
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
vipUuid String body (contained in the params structure) The VIP UUID. 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

API Response

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"
    }
}

SDK Sample

Java SDK
CreateLoadBalancerAction action = new CreateLoadBalancerAction();
action.name = "Test-Lb";
action.vipUuid = "861b79a91e894ea68f77ffd7007bb57d";
action.sessionId = "056fdb04a78544fd9a43f757d6af4700";
CreateLoadBalancerAction.Result res = action.call();
Python SDK
CreateLoadBalancerAction action = CreateLoadBalancerAction()
action.name = "Test-Lb"
action.vipUuid = "3b1839e4bef9437a9b0cf28789951009"
action.sessionId = "b21c8f46991440d48be3dcf5c4a36f15"
CreateLoadBalancerAction.Result res = action.call()

DeleteLoadBalancer

API Request

URLs
DELETE/v1/load-balancers/listeners/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 1ac325e9a263466d88a9bdf44c64ce96" \
-X DELETE http://localhost:8080/zstack/v1/load-balancers/listeners/db191bc52926462eb21d24b30db7971f
Request Parameters
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

API Response

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"
	}
}

SDK Sample

Java SDK
DeleteLoadBalancerListenerAction action = new DeleteLoadBalancerListenerAction();
action.uuid = "2e7918e14cb345888cb57769f117fb91";
action.sessionId = "efa96e940fce42c58c5e43885ce1f37f";
DeleteLoadBalancerListenerAction.Result res = action.call();
Python SDK
DeleteLoadBalancerListenerAction action = DeleteLoadBalancerListenerAction()
action.uuid = "be721492004a49038940201562070e1e"
action.sessionId = "4a6baa8346204970bf3ce9397f48504a"
DeleteLoadBalancerListenerAction.Result res = action.call()

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()

RefreshLoadBalancer

API Request

URLs
PUT zstack/v1/load-balancers/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
"refreshLoadBalancer": {},
"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 b1e125550d924d17a0efa1bb6dd36806" \
-X PUT -d '{"refreshLoadBalancer":{}}' \
http://localhost:8080/zstack/v1/load-balancers/9fb0a5a16d06393db160485b0b79fd49/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample Response
{
"inventory": {
"name": "Test-Lb",
"uuid": "ee6de94ed5bf49c8b09a7bd3e5965c60",
"vipUuid": "691e275592d84c898c1d495febf42a9a"
  }
}
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 LoadBalancerInventory See inventory. 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 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
#inventory
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
aclRefs List See aclRefs. 3.9.0
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
#aclRefs
Name Type Description Starting Version
id Long The resource UUID. 3.9.0
listenerUuid String The listener UUID. 3.9.0
aclUuid String The UUID of the access control list group. 3.9.0
type String The type of the access control list. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
#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
RefreshLoadBalancerAction action = new RefreshLoadBalancerAction();
action.uuid = "cad53be6896e43cf8aef4021d165f56d";
action.sessionId = "fec73392481a4edaa2738131516ef0d7";
RefreshLoadBalancerAction.Result res = action.call();
Python SDK
RefreshLoadBalancerAction action = RefreshLoadBalancerAction()
action.uuid = "3556da2f1d3b47e48ec3068a5c3055ba"
action.sessionId = "9947fe6582f44b5a961143d08f49a2eb"
RefreshLoadBalancerAction.Result res = action.call()

CreateLoadBalancerListener

API Request

URLs
POST zstack/v1/load-balancers/{loadBalancerUuid}/listeners
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "Test-Listener",
    "instancePort": 80.0,
    "loadBalancerPort": 80.0,
    "protocol": "http"
    "aclStatus": "disable",
    "aclType": "black"
  },
  "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":"Test-Listener","instancePort":80.0,"loadBalancerPort":80.0,"protocol":"http","aclStatus":"disable","aclType":"black"}}'
http://localhost:8080/zstack/v1/load-balancers/192b3fe960d63e078ced8f59529a25ad/listeners
Request Parameters
Name Type Location Description Optional Value Starting Version
loadBalancerUuid String url The UUID of the load balancer listener. 0.6
name String body (contained in the params structure) The name of the load balancer listener. 0.6
description String body (contained in the params structure) Optional. The detailed description of the resource. 0.6
instancePort Integer body (contained in the params structure) Optional. The VM port. 0.6
loadBalancerPort int body (contained in the params structure) The load balancer port. 0.6
protocol String body (contained in the params structure) Optional. The protocol.
  • tcp
  • http
  • https
  • udp
3.0.0
certificateUuid String body (contained in the params structure) Optional. The certificate UUID. 2.3.2
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 0.6
instancePort Integer body (contained in the params structure) Optional. 3.9.0
healthCheckProtocol String body (contained in the params structure) Optional. The health check protocol.
  • tcp
  • udp
  • http
3.9.0
healthCheckMethod String body (contained in the params structure) Optional. The health check method.
  • GET
  • HEAD
3.9.0
healthCheckURI String body (contained in the params structure) Optional. The health check URI. 3.9.0
healthCheckHttpCode String body (contained in the params structure) Optional. The expected response code of the health check. 3.9.0
aclStatus String body (contained in the params structure) The access control status.
  • enable
  • disable
3.9.0
aclUuids list body (contained in the params structure) Optional. The access control list. 3.9.0
aclType String body (contained in the params structure) Optional. The access control type.
  • white
  • black
3.9.0
tagUuids list body (contained in the params structure) Optional. The tag UUID list. 3.9.0
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6
Note:
  • When you create a load balancer listener in ZStack Cloud, you can set seven layers of health check parameters by adding the healthCheckParameter option to SystemTags.
    • Format of the healthCheckParameter option: healthCheckParameter::{parameter}. Here, the parameter can be healthCheckParameter::method:uri:expect-result.
    • Example: healthCheckParameter::GET:/healthstatus.html:http_2xx
  • When you create a load balancer listener in ZStack Cloud, you can set the access control status of the listener by adding the accessControlStatus option to SystemTags.
    • Format of the accessControlStatus option: accessControlStatus::{status}
    • Example: accessControlStatus::enable
  • When you create a load balancer listener in ZStack Cloud, you can set whether to enable the session persistence and specify the session persistence mode by adding the sessionPersistence option to SystemTags.
    • Format of the sessionPersistenceoption: sessionPersistence::{%s}.. The value of %s can be disable/iphash/insert/rewrite.
    • Example: sessionPersistence::insert.
  • When you create a load balancer listener in ZStack Cloud, you can specify the session persistence time by adding the sessionIdleTimeout option to SystemTags.
    • Format of the sessionIdleTimeoutoption: sessionIdleTimeout::{%s}. Here, %s is the session persistence time. Valid value: 30-3600. Unit:second.
    • Example: sessionIdleTimeout::60
  • When you create a load balancer listener in ZStack Cloud, you can set the rewritten cookie name by adding the cookieName option to SystemTags.
    • Format of the validRegexValues::{%s}. Here, %s is the cookie name. The name must be 1 to 20 characters and can contain uppercase or lowercase letters, digits, hyphens (-), and underscores (_).
    • Example: cookieName::zstack-cookie.
  • When you create a load balancer listener in ZStack Cloud, you can set whether to enable http redirect by adding the httpRedirectHttps option to SystemTags.
    • Format of the httpRedirectHttps::{%s}. Here, the value of %s can be disable/enable.
    • Example: httpRedirectHttps::enable
  • When you create a load balancer listener in ZStack Cloud, you can set redirect port by adding redirectPort option to SystemTags.
    • Format of the redirectPort::{%s}. Here, the number range of %s can be 1-65535.
    • Example: redirectPort::80
  • When you create a load balancer listener in ZStack Cloud, you can set redirect status code by adding statusCode optional to SystemTags.
    • Format of the statusCode::{%s}. Here, the value of %s can be 301/302/303/307/308.
    • Example: statusCode::302

API Response

Sample Response
{
  "inventory": {
    "uuid": "e82212513e2f3644885d98ce164ee687",
    "name": "Test-Listener",
    "loadBalancerUuid": "f7b267e9a5683ba5981b79196ca65d47",
    "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. 0.6
inventory LoadBalancerListenerInventory See inventory. 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 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
#inventory
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
aclRefs List See aclRefs. 3.9.0
certificateRefs List See certificateRefs. 2.3.2
#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
#aclRefs
Name Type Description Starting Version
id Long The resource UUID. 3.9.0
listenerUuid String The listener UUID. 3.9.0
aclUuid String The UUID of the access control list. 3.9.0
type String The access control type. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
#certificateRefs
Name Type Description Starting Version
id Long 2.3
listenerUuid String 2.3
certificateUuid String 2.3.2
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

SDK Sample

Java SDK
CreateLoadBalancerListenerAction action = new CreateLoadBalancerListenerAction();
action.loadBalancerUuid = "192b3fe960d63e078ced8f59529a25ad";
action.name = "Test-Listener";
action.instancePort = 80.0;
action.loadBalancerPort = 80.0;
action.protocol = "http";
action.aclStatus = "disable";
action.aclType = "black";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateLoadBalancerListenerAction.Result res = action.call();
Python SDK
CreateLoadBalancerListenerAction action = CreateLoadBalancerListenerAction()
action.loadBalancerUuid = "192b3fe960d63e078ced8f59529a25ad"
action.name = "Test-Listener"
action.instancePort = 80.0
action.loadBalancerPort = 80.0
action.protocol = "http"
action.aclStatus = "disable"
action.aclType = "black"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateLoadBalancerListenerAction.Result res = action.call()

DeleteLoadBalancerListener

API Request

URLs
DELETE/v1/load-balancers/listeners/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 1ac325e9a263466d88a9bdf44c64ce96" \
-X DELETE http://localhost:8080/zstack/v1/load-balancers/listeners/db191bc52926462eb21d24b30db7971f?
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

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"
    }
}

SDK Sample

Java SDK
DeleteLoadBalancerListenerAction action = new DeleteLoadBalancerListenerAction();
action.uuid = "2e7918e14cb345888cb57769f117fb91";
action.sessionId = "efa96e940fce42c58c5e43885ce1f37f";
DeleteLoadBalancerListenerAction.Result res = action.call();
Python SDK
DeleteLoadBalancerListenerAction action = DeleteLoadBalancerListenerAction()
action.uuid = "be721492004a49038940201562070e1e"
action.sessionId = "4a6baa8346204970bf3ce9397f48504a"
DeleteLoadBalancerListenerAction.Result res = action.call()

QueryLoadBalancerListener

API Request

URLs
GET zstack/v1/load-balancers/listeners
GET zstack/v1/load-balancers/listeners/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 6d7ca1c2f39440d5a4110962854c3234" \
-X GET http://localhost:8080/zstack/v1/load-balancers/listeners
curl \
-H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 057112ec0d5e4bcd9193b1f9499169eb" \
-X GET http://localhost:8080/zstack/v1/load-balancers/listeners/cdf776df1cb04ae6a3cf1fb1330dab2d

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryLoadBalancerListener, and pressing the Tab key.

API Response

Sample Response
{
"inventories": [
    {
"uuid": "be2f6e299e364f5cb71e52f11eeee34e",
"name": "Test-Listener",
"loadBalancerUuid": "90a89f6ec62b4acf9ccb770b453fddc5",
"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. 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 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
#inventories
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
QueryLoadBalancerListenerAction action = new QueryLoadBalancerListenerAction();
action.conditions = asList();
action.sessionId = "c616bc4ee56648b6a921b2da70fe7798";
QueryLoadBalancerListenerAction.Result res = action.call();
Python SDK
QueryLoadBalancerListenerAction action = QueryLoadBalancerListenerAction()
action.conditions = []
action.sessionId = "529b237f77cd4130b861ebe99a30c983"
QueryLoadBalancerListenerAction.Result res = action.call()

UpdateLoadBalancerListener

API Request

URLs
PUT zstack/v1/load-balancers/listeners/{uuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateLoadBalancerListener": {
    "name": "Test-Listener",
    "description": "desc info"
  },
  "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 PUT -d '{"updateLoadBalancerListener":{"name":"Test-Listener","description":"desc info"}}' \
http://localhost:8080/zstack/v1/load-balancers/listeners/6566eed5ab7432d2956b1c093d25daab
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
name String body (contained in the updateLoadBalancerListener structure) Optional. The resource name. 0.6
description String body (contained in the updateLoadBalancerListener structure) Optional. The detailed description of the resource. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample Response
{
  "inventory": {
    "uuid": "84735dfea01d359196587f35314a1e17",
    "name": "Test-Listener",
    "description": "desc info",
    "loadBalancerUuid": "c8f77d0df3c83e449f0d372dbe80bd09",
    "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. 0.6
inventory LoadBalancerListenerInventory See inventory. 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 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
#inventory
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
UpdateLoadBalancerListenerAction action = new UpdateLoadBalancerListenerAction();
action.uuid = "6566eed5ab7432d2956b1c093d25daab";
action.name = "Test-Listener";
action.description = "desc info";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateLoadBalancerListenerAction.Result res = action.call();
Python SDK
UpdateLoadBalancerListenerAction action = UpdateLoadBalancerListenerAction()
action.uuid = "6566eed5ab7432d2956b1c093d25daab"
action.name = "Test-Listener"
action.description = "desc info"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateLoadBalancerListenerAction.Result res = action.call()

ChangeLoadBalancerListener

API Response

URLs
PUT zstack/v1/load-balancers/listeners/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeLoadBalancerListener": {
    "connectionIdleTimeout": 300,
    "maxConnection": 5000,
    "balancerAlgorithm": "roundrobin",
    "healthCheckTarget": "default",
    "healthyThreshold": 2,
    "unhealthyThreshold": 3,
    "healthCheckInterval": 5,
    "nbprocess": 1,
    "httpMode": "http-keep-alive",
    "sessionPersistence": "insert",
    "sessionIdleTimeout": 60
  },
  "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 PUT -d '{"changeLoadBalancerListener":{"connectionIdleTimeout":300,"maxConnection":5000,"balancerAlgorithm":"roundrobin","healthCheckTarget":"default","healthyThreshold":2,"unhealthyThreshold":3,"healthCheckInterval":5,"nbprocess":1,"httpMode":"http-keep-alive","sessionPersistence":"insert","sessionIdleTimeout":60}}'
http://localhost:8080/zstack/v1/load-balancers/listeners/ca4f7cea0c5a3a329742b127d7f80615/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.4.0
connectionIdleTimeout Integer body (contained in the changeLoadBalancerListener structure) Optional. The connection timeout. 4.6.0
maxConnection Integer body (contained in the changeLoadBalancerListener structure) Optional. The maximum number of concurrent connections. 4.6.0
balancerAlgorithm String body (contained in the changeLoadBalancerListener structure) Optional. The load balancing algorithm.
  • weightroundrobin
  • roundrobin
  • leastconn
  • source
4.6.0
healthCheckTarget String body (contained in the changeLoadBalancerListener structure) Optional. The health check port. 4.6.0
healthyThreshold Integer body (contained in the changeLoadBalancerListener structure) Optional. The threshold of the healthy state. 4.6.0
unhealthyThreshold Integer body (contained in the changeLoadBalancerListener structure) Optional. The threshold of the unhealthy state. 4.6.0
healthCheckInterval Integer body (contained in the changeLoadBalancerListener structure) Optional. The health check interval. 4.6.0
healthCheckProtocol String body (contained in the changeLoadBalancerListener structure) Optional. The health check protocol.
  • tcp
  • udp
  • http
3.9.0
healthCheckMethod String body (contained in the changeLoadBalancerListener structure) Optional. The health check method.
  • GET
  • HEAD
3.9.0
healthCheckURI String body (contained in the changeLoadBalancerListener structure) Optional. The health check URI. 3.9.0
healthCheckHttpCode String body (contained in the changeLoadBalancerListener structure) Optional. The expected response code of the health check. 3.9.0
aclStatus String body (contained in the changeLoadBalancerListener structure) The access control status.
  • enable
  • disable
3.9.0
securityPolicyType String body (contained in the changeLoadBalancerListener structure) The transport layer security policy.
  • tls_cipher_policy_default
  • tls_cipher_policy_1_0
  • tls_cipher_policy_1_1
  • tls_cipher_policy_1_2
  • tls_cipher_policy_1_2_strict
  • tls_cipher_policy_1_2_strict_with_1_3
4.1.0
nbprocess Integer body (contained in the changeLoadBalancerListener structure) The number of SLB processes. 4.1.0
httpMode String body (contained in the changeLoadBalancerListener structure) The HTTP mode of SLB.
  • http-keep-alive
  • http-server-close
  • http-tunnel
  • httpclose
  • forceclose
4.1.0
sessionPersistence String body (contained in the changeLoadBalancerListener structure) The session persistence mode.
  • disable
  • iphash
  • insert
  • rewrite
4.6.0
sessionIdleTimeout Integer body (contained in the changeLoadBalancerListener structure) The session persistence time. 4.6.0
cookieName String body (contained in the changeLoadBalancerListener structure) The Cookie name. 4.6.0
systemTags List body Optional. The system tags. 3.4.0
userTags List body Optional. The user tags. 3.4.0
httpRedirectHttps String body (contained in the changeLoadBalancerListener structure) Optional. The http redirects https.
  • disable
  • enable
4.7.21
redirectPort Integer body (contained in the changeLoadBalancerListener structure) Optional. The redirect port. 4.7.21
statusCode Integer body (contained in the changeLoadBalancerListener structure) Optional. The redirect status code.
  • 301
  • 302
  • 303
  • 307
  • 308
4.7.21
Note:
  • When you change a parameter of a load balancer listener in ZStack Cloud, you can set the weight of the backend server by adding the balancerWeight option to SystemTags.
    • Format of the balancerWeight option: balancerWeight::{nicUuid}::{weight} . Here, weight is the weight of the backend server. Weight range: 0-100, integer. Default value: 100.
    • Example: balancerWeight::{"c44007641c9040c6b2587e19b1b3e2b0"}::{100}

API Response

Sample Response
{
  "inventory": {
    "uuid": "6356c8f8ae7534bab9a2175144dbc997",
    "name": "Test-Listener",
    "description": "desc info",
    "loadBalancerUuid": "4b32d1a27d8e3d77a606e5014caddd86",
    "instancePort": 80,
    "loadBalancerPort": 80,
    "protocol": "http"
  }
}
Name Type Description Starting Version
success boolean 4.6.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.4.0
inventory LoadBalancerListenerInventory See inventory. 3.4.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. 3.4.0
description String The brief description of the error. 3.4.0
details String The details about the error. 3.4.0
elaboration String The reserved field. Default value: null. 3.4.0
opaque LinkedHashMap The reserved field. Default value: null. 3.4.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. 3.4.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.4.0
name String The resource name. 3.4.0
description String The detailed description of the resource. 3.4.0
loadBalancerUuid String The load balancer UUID. 3.4.0
instancePort Integer 3.4.0
loadBalancerPort Integer 3.4.0
protocol String 3.4.0
createDate Timestamp The creation date. 3.4.0
lastOpDate Timestamp The last operation date. 3.4.0
vmNicRefs List See vmNicRefs. 3.4.0
aclRefs List See aclRefs. 3.9.0
certificateRefs List See certificateRefs. 3.4.0
#vmNicRefs
Name Type Description Starting Version
id Long 3.4.0
listenerUuid String 3.4.0
vmNicUuid String The VM NIC UUID. 3.4.0
status String 3.4.0
createDate Timestamp The creation date. 3.4.0
lastOpDate Timestamp The last operation date. 3.4.0
#aclRefs
Name Type Description Starting Version
id Long The resource UUID. 3.9.0
listenerUuid String The listener UUID. 3.9.0
aclUuid String The UUID of the access control list. 3.9.0
type String The access control type. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
#certificateRefs
Name Type Description Starting Version
id Long 3.4.0
listenerUuid String 3.4.0
certificateUuid String 3.4.0
createDate Timestamp The creation date. 3.4.0
lastOpDate Timestamp The last operation date. 3.4.0

SDK Sample

Java SDK
ChangeLoadBalancerListenerAction action = new ChangeLoadBalancerListenerAction();
action.uuid = "ca4f7cea0c5a3a329742b127d7f80615";
action.connectionIdleTimeout = 300;
action.maxConnection = 5000;
action.balancerAlgorithm = "roundrobin";
action.healthCheckTarget = "default";
action.healthyThreshold = 2;
action.unhealthyThreshold = 3;
action.healthCheckInterval = 5;
action.nbprocess = 1;
action.httpMode = "http-keep-alive";
action.sessionPersistence = "insert";
action.sessionIdleTimeout = 60;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeLoadBalancerListenerAction.Result res = action.call();
Python SDK
ChangeLoadBalancerListenerAction action = ChangeLoadBalancerListenerAction()
action.uuid = "ca4f7cea0c5a3a329742b127d7f80615"
action.connectionIdleTimeout = 300
action.maxConnection = 5000
action.balancerAlgorithm = "roundrobin"
action.healthCheckTarget = "default"
action.healthyThreshold = 2
action.unhealthyThreshold = 3
action.healthCheckInterval = 5
action.nbprocess = 1
action.httpMode = "http-keep-alive"
action.sessionPersistence = "insert"
action.sessionIdleTimeout = 60
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeLoadBalancerListenerAction.Result res = action.call()

GetCandidateVmNicsForLoadBalancer

API Request

URLs
GET zstack/v1/load-balancers/listeners/{listenerUuid}/vm-instances/candidate-nics
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth e75a29e482104fd094dde90d69b212c6" \
-X GET http://localhost:8080/zstack/v1/load-balancers/listeners/4fe68eaa71ec47699c19b7819bd52f80/vm-instances/candidate-nics
Request Parameters
Name Type Location Description Optional Value Starting Version
listenerUuid String url The UUID of the load balancer listener. 0.6
systemTags List query Optional. The system tags. 0.6
userTags List query Optional. The user tags. 0.6

API Response

Sample Response
{
"inventories": [
    {
"uuid": "241c356448ea4dfab7e95dd1e52a163d",
"vmInstanceUuid": "5d0f9bee14d94943a4e6ec34c599dc19",
"usedIpUuid": "2974a99c5bc2481cb54759c83fea8f52",
"l3NetworkUuid": "a3dfb2211d6e4d538a73bb3453876654",
"ip": "192.168.1.10",
"mac": "00:0c:29:bd:99:fc",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"deviceId": 0.0,
"createDate": "Jun 7, 2017 9:21:22 PM",
"lastOpDate": "Jun 7, 2017 9:21:22 PM"
    }
  ]
}
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 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
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 0.6
vmInstanceUuid String The VM instance UUID. 0.6
l3NetworkUuid String The L3 network UUID. 0.6
ip String 0.6
mac String 0.6
netmask String 0.6
gateway String 0.6
metaData String 0.6
deviceId Integer 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

SDK Sample

Java SDK
GetCandidateVmNicsForLoadBalancerAction action = new GetCandidateVmNicsForLoadBalancerAction();
action.listenerUuid = "939a6fd54937468b9b9c27c4d3903c6e";
action.sessionId = "af93732431cf45e7828b579fcb9e46bc";
GetCandidateVmNicsForLoadBalancerAction.Result res = action.call();
Python SDK
GetCandidateVmNicsForLoadBalancerAction action = GetCandidateVmNicsForLoadBalancerAction()
action.listenerUuid = "a100b63272ff460eb0301f5759ff2fce"
action.sessionId = "423e456aac8041aa9bfdf4ce26ab32ce"
GetCandidateVmNicsForLoadBalancerAction.Result res = action.call()

AddVmNicToLoadBalancer

API Request

URLs
POST zstack/v1/load-balancers/listeners/{listenerUuid}/vm-instances/nics
Headers
Authorization: OAuth the-session-uuid
Body
{
"params": {
"vmNicUuids": [
"aadbfdd8413545d9a1d53d8a0cfa58a8"
    ]
  },
"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 47ac995879a9490f83b6b6ef79bca99f" \
-X POST -d '{"params":{"vmNicUuids":["f141d926d13b34cc905507ce7aa9a479"]}}' \
http://localhost:8080/zstack/v1/load-balancers/listeners/21e488793c5831a0842d72a63bcdaf04/vm-instances/nics
Request Parameters
Name Type Location Description Optional Value Starting Version
vmNicUuids List body (contained in the params structure) The VM NIC UUIDs. 0.6
listenerUuid String url The UUID of the load balancer listener. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6
Note:
  • When you add a VM NIC to a load balancer in ZStack Cloud, you can set the weight of the backend server by adding the balancerWeight option to SystemTags.
    • Format of the balancerWeight option: balancerWeight::{nicUuid}::{weight}. Here, weight is the weight of the backend server. Weight range: 0-100, integer. Default value: 100.
    • Example: balancerWeight::{"c44007641c9040c6b2587e19b1b3e2b0"}::{100}

API Response

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"
    }
}

SDK Sample

Java SDK
AddVmNicToLoadBalancerAction action = new AddVmNicToLoadBalancerAction();
action.vmNicUuids = asList("01741d3cc9d0422197b2176f3c977d52");
action.listenerUuid = "fd774b08700545ddaa5938fb2ccf4320";
action.sessionId = "ed5ea413b2354a94ac7b427528f88d26";
AddVmNicToLoadBalancerAction.Result res = action.call()
Python SDK
AddVmNicToLoadBalancerAction action = AddVmNicToLoadBalancerAction()
action.vmNicUuids = [9b08b7603be945d2928a08a0e8d1fc00]
action.listenerUuid = "874bcad239a645af8cd69ed267a48809"
action.sessionId = "a70b5f9862424ceb8ea8e2c7d679e0df"
AddVmNicToLoadBalancerAction.Result res = action.call()

RemoveVmNicFromLoadBalancer

API Request

URLs
DELETE/v1/load-balancers/listeners/{listenerUuid}/vm-instances/nics?vmNicUuids={vmNicUuids}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth a846184b54d845dbb85e50ba35364b6e" \
-X DELETE http://localhost:8080/zstack/v1/load-balancers/listeners/9fda51c382d841e0a47a4195f8dac67b/vm-instances/nics?vmNicUuids=9952aa24a745355b866782dd9b1c53e8
Request Parameters
Name Type Location Description Optional Value Starting Version
vmNicUuids List body The VM NIC UUIDs. 0.6
listenerUuid String url The UUID of the load balancer listener. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample Response
{
"inventory": {
"name": "Test-Lb",
"uuid": "40f1e1e109d34feaa119ad14b7ed5638",
"vipUuid": "d3968f8dd2764d988f09b251617b2cf9"
  }
}
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 LoadBalancerInventory See inventory. 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 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
#inventory
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
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
#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

SDK Sample

Java SDK
RemoveVmNicFromLoadBalancerAction action = new RemoveVmNicFromLoadBalancerAction();
action.vmNicUuids = asList("6d6c33021c0a432c9030046c3a24be6e");
action.listenerUuid = "0a11bad9fdb84538953689a5c4430126";
action.sessionId = "867ccf6fbe934fe19e8bb5ba861de7fd";
RemoveVmNicFromLoadBalancerAction.Result res = action.call();
Python SDK
RemoveVmNicFromLoadBalancerAction action = RemoveVmNicFromLoadBalancerAction()
action.vmNicUuids = [ef9de345e68f4e6aa51164eff6ee5249]
action.listenerUuid = "04f42584e0a14afdb382e0961f057076"
action.sessionId = "46c7dabf668943faa1bb8b6be0d60397"
RemoveVmNicFromLoadBalancerAction.Result res = action.call()

UpdateLoadBalancer

API Request

URLs
PUT zstack/v1/load-balancers/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateLoadBalancer": {
    "name": "Test-Lb",
    "description": "info"
  },
  "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 PUT -d '{"updateLoadBalancer":{"name":"Test-Lb","description":"info"}}' \
http://localhost:8080/zstack/v1/load-balancers/a355359f46d13e5ab64d6eeff66aedbf/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
name String body (contained in the updateLoadBalancer structure) Optional. The resource name. 0.6
description String body (contained in the updateLoadBalancer structure) Optional. The detailed description of the resource. 0.6
resourceUuid String body (contained in the updateLoadBalancer structure) Optional. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

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"
    }
}

SDK Sample

Java SDK
UpdateLoadBalancerAction action = new UpdateLoadBalancerAction();
action.uuid = "a355359f46d13e5ab64d6eeff66aedbf";
action.name = "Test-Lb";
action.description = "info";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateLoadBalancerAction.Result res = action.call();
Python SDK
UpdateLoadBalancerAction action = UpdateLoadBalancerAction()
action.uuid = "a355359f46d13e5ab64d6eeff66aedbf"
action.name = "Test-Lb"
action.description = "info"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateLoadBalancerAction.Result res = action.call()

CreateCertificate

API Request

URLs
POST zstack/v1/certificates
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "www.domain.com",
    "certificate": "-----BEGIN PRIVATE KEY-----MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDIpe/zscx2QwunyYPHusMCt/5n4LWSi4pzfsUfvzo4txTe7WwWZ4H3iEA7RwSkg49xx3Rn6jh9S0RMncqUjTxPUjlZKoN0w+nU2AsxXhbV8AiS3UoWJcZUtlfLAjeUKajy1F5hyxHsKJlmOozAcXObunzuaWkKvjchqMSX54+E02h7JNtzv9lagr0MsB4hkraanlpQWr4mv3N7D8kBz9wplMeJXeo4awls3kygiN63TnIQ5hzF7jNxR3uSFYQtUfLnzKcj4aIma62tDf6pkpQ3S+SprGs/OkGvEldNus6FXTO7ixFyORM27ka3Rmv6SYQQquV+950xfb42n9s2UE0pAgMBAAECggEAd0Ixye3O8ifNgLAE1K0MBcyouMNWCMFJzHX34nO9vkILdKk3imWBWUgxrUn713CezOjZJn6PjuEyujs7UmpUA22Cyp27PqbHkAvNM02SUxx1bB19UIapSGaM7gvmTvkoAxT4+DVD9NL4wktgp22HYnNImEgs+AaxLB9sokEvC6mxP23pv7LfnK4EDH2b+1pbE++VheVIBZxK+mTdxPRgwQBJv2VtK0LRDndnRU8gmB5O0KBnep3sCsAKmWtAJf37L9lWgc9QC7LysnuMsZ10KuoeQndVetsAazBARHhUdLd1fWQqbLklC6NtcLodoS+umuvHArKx6LungK4cmNyGZQKBgQD8abrSQXOJuNNx7N+EJjn3hjc3FOrSAgGY7LCiQ/qEP8EkWslxotRHKqKqz78oq4RApT/fBV17HqPe67IJ5xhwYlIUASzs8WvigRV6ITSZv92G8iOSdW7ALZzF4q+tc2RgPvW/pZPaHoxfNU6TC/QW35qAslPWab7Tel9cGb030wKBgQDLf+OLfUfhJUq8mZ3L8U1p1QLpSJNx282hGVg+OXwpuQQZ5qrxkhzF/xBYCjmMQMEfxLtRJxYTPgkHcTp9ozl4ICXdmH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VzaGl4aW4ucnVhbkB6c3RhY2suaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIpe/zscx2QwunyYPHusMCt/5n4LWSi4pzfsUfvzo4txTe7WwWZ4H3iEA7RwSkg49xx3Rn6jh9S0RMncqUjTxPUjlZKoN0w+nU2AsxXhbV8AiS3UoWJcZUtlfLAjeUKajy1F5hyxHsKJlmOozAcXObunzuaWkKvjchqMSX54+E02h7JNtzv9lagr0MsB4hkraanlpQWr4mv3N7D8kBz9wplMeJXeo4awls3kygiN63TnIQ5hzF7jNxR3uSFYQtUfLnzKcj4aIma62tDf6pkpQ3S+SprGs/OkGvEldNus6FXTO7ixFyORM27ka3Rmv6SYQQquV+950xfb42n9s2UE0pAgMBAAGjUDBOMB0GA1UdDgQWBBTg8PjTZJmWSDA9GPTJ7K5wWTPVsjAfBgNVHSMEGDAWgBTg8PjTZJmWSDA9GPTJ7K5wWTPVsjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDH5POu4FmmAsHXe49gL6Y6Kdcti2FTBYse7ru05V4URGsU5Dab25mATqp7z7WCiv9pTdlC0KoJieML7rpLiLskBBLpToU8bUigX96q5dmMtDbLSmGeYfhHj9tHeYuGv0U2eRcN2Jo6xlHrl6X3RazO/h/9mCW6sLAGgaJ9MyQAiqRfYaO+ToBqdbHmBEwmueaOO7wFy9UbU7F/CdeEzblKdWRMKQgf5yxA6pXYghjPWWNAqElxnnXskBmjMhYaDfGCQuRK5Ma362ax0i8UGqYfMnflBgy1qX8+f7VjyWokK4tcjep72TTYkIVBGbwBMqk2U2v5qslBRmM5+pmAESJq-----END CERTIFICATE-----"
  },
  "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":"www.domain.com","certificate":"-----BEG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scx2QwunyYPHusMCt/5n4LWSi4pzfsUfvzo4txTe7WwWZ4H3iEA7RwSkg49xx3Rn6jh9S0RMncqUjTxPUjlZKoN0w+nU2AsxXhbV8AiS3UoWJcZUtlfLAjeUKajy1F5hyxHsKJlmOozAcXObunzuaWkKvjchqMSX54+E02h7JNtzv9lagr0MsB4hkraanlpQWr4mv3N7D8kBz9wplMeJXeo4awls3kygiN63TnIQ5hzF7jNxR3uSFYQtUfLnzKcj4aIma62tDf6pkpQ3S+SprGs/OkGvEldNus6FXTO7ixFyORM27ka3Rmv6SYQQquV+950xfb42n9s2UE0pAgMBAAGjUDBOMB0GA1UdDgQWBBTg8PjTZJmWSDA9GPTJ7K5wWTPVsjAfBgNVHSMEGDAWgBTg8PjTZJmWSDA9GPTJ7K5wWTPVsjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDH5POu4FmmAsHXe49gL6Y6Kdcti2FTBYse7ru05V4URGsU5Dab25mATqp7z7WCiv9pTdlC0KoJieML7rpLiLskBBLpToU8bUigX96q5dmMtDbLSmGeYfhHj9tHeYuGv0U2eRcN2Jo6xlHrl6X3RazO/h/9mCW6sLAGgaJ9MyQAiqRfYaO+ToBqdbHmBEwmueaOO7wFy9UbU7F/CdeEzblKdWRMKQgf5yxA6pXYghjPWWNAqElxnnXskBmjMhYaDfGCQuRK5Ma362ax0i8UGqYfMnflBgy1qX8+f7VjyWokK4tcjep72TTYkIVBGbwBMqk2U2v5qslBRmM5+pmAESJq-----END CERTIFICATE-----"}}' http://localhost:8080/zstack/v1/certificates
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) The resource name. 2.3.2
certificate String body (contained in the params structure) 2.3.2
description String body (contained in the params structure) Optional. The detailed description of the resource. 2.3.2
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 2.3.2
systemTags List body Optional. The system tags. 2.3.2
userTags List body Optional. The user tags. 2.3.2

API Response

Sample Response
{
  "inventory": {
    "name": "www.domain.com",
    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EKAoIBAQDIpe/zscx2QwunyYPHusMCt/5n4LWSi4pzfsUfvzo4txTe7WwWZ4H3iEA7RwSkg49xx3Rn6jh9S0RMncqUjTxPUjlZKoN0w+nU2AsxXhbV8AiS3UoWJcZUtlfLAjeUKajy1F5hyxHsKJlmOozAcXObunzuaWkKvjchqMSX54+E02h7JNtzv9lagr0MsB4hkraanlpQWr4mv3N7D8kBz9wplMeJXeo4awls3kygiN63TnIQ5hzF7jNxR3uSFYQtUfLnzKcj4aIma62tDf6pkpQ3S+SprGs/OkGvEldNus6FXTO7ixFyORM27ka3Rmv6SYQQquV+950xfb42n9s2UE0pAgMBAAGjUDBOMB0GA1UdDgQWBBTg8PjTZJmWSDA9GPTJ7K5wWTPVsjAfBgNVHSMEGDAWgBTg8PjTZJmWSDA9GPTJ7K5wWTPVsjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDH5POu4FmmAsHXe49gL6Y6Kdcti2FTBYse7ru05V4URGsU5Dab25mATqp7z7WCiv9pTdlC0KoJieML7rpLiLskBBLpToU8bUigX96q5dmMtDbLSmGeYfhHj9tHeYuGv0U2eRcN2Jo6xlHrl6X3RazO/h/9mCW6sLAGgaJ9MyQAiqRfYaO+ToBqdbHmBEwmueaOO7wFy9UbU7F/CdeEzblKdWRMKQgf5yxA6pXYghjPWWNAqElxnnXskBmjMhYaDfGCQuRK5Ma362ax0i8UGqYfMnflBgy1qX8+f7VjyWokK4tcjep72TTYkIVBGbwBMqk2U2v5qslBRmM5+pmAESJq-----END CERTIFICATE-----"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.3.2
inventory CertificateInventory See inventory. 2.3.2
#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. 2.3.2
description String The detailed description of the error. 2.3.2
details String The details about the error. 2.3.2
elaboration String The reserved field. Default value: null. 2.3.2
opaque LinkedHashMap The reserved field. Default value: null. 2.3.2
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 2.3.2
#inventory
Name Type Description Starting Version
name String The resource name. 2.3.2
uuid String The resource UUID. 2.3.2
certificate String The certificate. 2.3.2
description String The detailed description of the resource. 2.3.2
createDate Timestamp The creation date. 2.3.2
lastOpDate Timestamp The last operation date. 2.3.2
listeners List See listeners. 2.3.2
#listeners
Name Type Description Starting Version
id Long 2.3.2
listenerUuid String 2.3.2
certificateUuid String 2.3.2
createDate Timestamp The creation date. 2.3.2
lastOpDate Timestamp The last operation date. 2.3.2

SDK Sample

Java SDK
CreateCertificateAction action = new CreateCertificateAction();
action.name = "www.domain.com";
action.certificate = "-----BEGIN PRIVATE KEY-----MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDIpe/zscx2QwunyYPHusMCt/5n4LWSi4pzfsUfvzo4txTe7WwWZ4H3iEA7RwSkg49xx3Rn6jh9S0RMncqUjTxPUjlZKoN0w+nU2AsxXhbV8AiS3UoWJcZUtlfLAjeUKajy1F5hyxHsKJlmOozAcXObunzuaWkKvjchqMSX54+E02h7JNtzv9lagr0MsB4hkraanlpQWr4mv3N7D8kBz9wplMeJXeo4awls3kygiN63TnIQ5hzF7jNxR3uSFYQtUfLnzKcj4aIma62tDf6pkpQ3S+SprGs/OkGvEldNus6FXTO7ixFyORM27ka3Rmv6SYQQquV+950xfb42n9s2UE0pAgMBAAECggEAd0Ixye3O8ifNgLAE1K0MBcyouMNWCMFJzHX34nO9vkILdKk3imWBWUgxrUn713CezOjZJn6PjuEyujs7UmpUA22Cyp27PqbHkAvNM02SUxx1bB19UIapSGaM7gvmTvkoAxT4+DVD9NL4wktgp22HYnNImEgs+AaxLB9sokEvC6mxP23pv7LfnK4EDH2b+1pbE++VheVIBZxK+mTdxPRgwQBJv2VtK0LRDndnRU8gmB5O0KBnep3sCsAKmWtAJf37L9lWgc9QC7LysnuMsZ10KuoeQndVetsAazBARHhUdLd1fWQqbLklC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6pXYghjPWWNAqElxnnXskBmjMhYaDfGCQuRK5Ma362ax0i8UGqYfMnflBgy1qX8+f7VjyWokK4tcjep72TTYkIVBGbwBMqk2U2v5qslBRmM5+pmAESJq-----END CERTIFICATE-----";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateCertificateAction.Result res = action.call();
Python SDK
CreateCertificateAction action = CreateCertificateAction()
action.name = "www.domain.com"
action.certificate = "-----BEGIN PRIVATE KEY-----MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDIpe/zscx2QwunyYPHusMCt/5n4LWSi4pzfsUfvzo4txTe7WwWZ4H3iEA7RwSkg49xx3Rn6jh9S0RMncqUjTxPUjlZKoN0w+nU2AsxXhbV8AiS3UoWJcZUtlfLAjeUKajy1F5hyxHsKJlmOozAcXObunzuaWkKvjchqMSX54+E02h7JNtzv9lagr0MsB4hkraanlpQWr4mv3N7D8kBz9wplMeJXeo4awls3kygiN63TnIQ5hzF7jNxR3uSFYQtUfLnzKcj4aIma62tDf6pkpQ3S+SprGs/OkGvEldNus6FXTO7ixFyORM27ka3Rmv6SYQQquV+950xfb42n9s2UE0pAgMBAAECggEAd0Ixye3O8ifNgLAE1K0MBcyouMNWCMFJzHX34nO9vkILdKk3imWBWUgxrUn713CezOjZJn6PjuEyujs7UmpUA22Cyp27PqbHkAvNM02SUxx1bB19UIapSGaM7gvmTvkoAxT4+DVD9NL4wktgp22HYnNImEgs+AaxLB9sokEvC6mxP23pv7LfnK4EDH2b+1pbE++VheVIBZxK+mTdxPRgwQBJv2VtK0LRDndnRU8gmB5O0KBnep3sCsAKmWtAJf37L9lWgc9QC7LysnuMsZ10KuoeQndVetsAazBARHhUdLd1fWQqbLklC6NtcLodoS+umuvHArKx6LungK4cmNyGZQKBgQD8abrSQXOJuNNx7N+EJjn3hjc3FOrSAgGY7LCiQ/qEP8EkWslxotRHKqKqz78oq4RApT/fBV17HqPe67IJ5xhwYlIUASzs8WvigRV6ITSZv92G8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4f24953a9edefb53ca0678c"
CreateCertificateAction.Result res = action.call()

DeleteCertificate

API Request

URLs
DELETE zstack/v1/certificates/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/certificates/378bccfaa21d3b7fbb7b9bb014d1541c
Request Parameters
Name Description Location Description Optional Value Starting Version
uuid String url The resource UUID. 2.3.2
deleteMode String body Optional. The delete mode. 2.3.2
systemTags List body Optional. The system tags. 2.3.2
userTags List body Optional. The user tags. 2.3.2

API Response

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"
    }
}

SDK Sample

Java SDK
DeleteCertificateAction action = new DeleteCertificateAction();
action.uuid = "378bccfaa21d3b7fbb7b9bb014d1541c";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteCertificateAction.Result res = action.call();
Python SDK
DeleteCertificateAction action = DeleteCertificateAction()
action.uuid = "378bccfaa21d3b7fbb7b9bb014d1541c"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteCertificateAction.Result res = action.call()

QueryCertificate

API Request

URLs
GET zstack/v1/certificates
GET zstack/v1/certificates/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/certificates
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/certificates/658b7eeb6e2e3ea28c4243ae24e20e07

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryCertificate, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "name": "www.domain.com",
      "certificate": "-----BEGIN PRIVATE KEY-----MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDIpe/zscx2QwunyYPHusMCt/5n4LWSi4pzfsUfvzo4txTe7WwWZ4H3iEA7RwSkg49xx3Rn6jh9S0RMncqUjTxPUjlZKoN0w+nU2AsxXhbV8AiS3UoWJcZUtlfLAjeUKajy1F5hyxHsKJlmOozAcXObunzuaWkKvjchqMSX54+E02h7JNtzv9lagr0MsB4hkraanlpQWr4mv3N7D8kBz9wplMeJXeo4awls3kygiN63TnIQ5hzF7jNxR3uSFYQtUfLnzKcj4aIma62tDf6pkpQ3S+SprGs/OkGvEldNus6FXTO7ixFyORM27ka3Rmv6SYQQquV+950xfb42n9s2UE0pAgMBAAECggEAd0Ixye3O8ifNgLAE1K0MBcyouMNWCMFJzHX34nO9vkILdKk3imWBWUgxrUn713CezOjZJn6PjuEyujs7UmpUA22Cyp27PqbHkAvNM02SUxx1bB19UIapSGaM7gvmTvkoAxT4+DVD9NL4wktgp22HYnNImEgs+AaxLB9sokEvC6mxP23pv7LfnK4EDH2b+1pbE++VheVIBZxK+mTdxPRgwQBJv2VtK0LRDndnRU8gmB5O0KBnep3sCsAKmWtAJf37L9lWgc9QC7LysnuMsZ10KuoeQndVetsAazBARHhUdLd1fWQqbLklC6NtcLodoS+umuvHArKx6LungK4cmNyGZQKBgQD8abrSQXOJuNNx7N+EJjn3hjc3FOrSAgGY7LCiQ/qEP8EkWslxotRHKqKqz78oq4RApT/fBV17HqPe67IJ5xhwYlIUASzs8WvigRV6ITSZv92G8iOSdW7ALZzF4q+tc2RgPvW/pZPaHoxfNU6TC/QW35qAslPWab7Tel9cGb030wKBgQDLf+OLfUfhJUq8mZ3L8U1p1QLpSJNx282hGVg+OXwpuQQZ5qrxkhzF/xBYCjmMQMEfxLtRJxYTPgkHcTp9ozl4ICXdmHpL8V+E5PB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ucnVhbkB6c3RhY2suaW8wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIpe/zscx2QwunyYPHusMCt/5n4LWSi4pzfsUfvzo4txTe7WwWZ4H3iEA7RwSkg49xx3Rn6jh9S0RMncqUjTxPUjlZKoN0w+nU2AsxXhbV8AiS3UoWJcZUtlfLAjeUKajy1F5hyxHsKJlmOozAcXObunzuaWkKvjchqMSX54+E02h7JNtzv9lagr0MsB4hkraanlpQWr4mv3N7D8kBz9wplMeJXeo4awls3kygiN63TnIQ5hzF7jNxR3uSFYQtUfLnzKcj4aIma62tDf6pkpQ3S+SprGs/OkGvEldNus6FXTO7ixFyORM27ka3Rmv6SYQQquV+950xfb42n9s2UE0pAgMBAAGjUDBOMB0GA1UdDgQWBBTg8PjTZJmWSDA9GPTJ7K5wWTPVsjAfBgNVHSMEGDAWgBTg8PjTZJmWSDA9GPTJ7K5wWTPVsjAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQDH5POu4FmmAsHXe49gL6Y6Kdcti2FTBYse7ru05V4URGsU5Dab25mATqp7z7WCiv9pTdlC0KoJieML7rpLiLskBBLpToU8bUigX96q5dmMtDbLSmGeYfhHj9tHeYuGv0U2eRcN2Jo6xlHrl6X3RazO/h/9mCW6sLAGgaJ9MyQAiqRfYaO+ToBqdbHmBEwmueaOO7wFy9UbU7F/CdeEzblKdWRMKQgf5yxA6pXYghjPWWNAqElxnnXskBmjMhYaDfGCQuRK5Ma362ax0i8UGqYfMnflBgy1qX8+f7VjyWokK4tcjep72TTYkIVBGbwBMqk2U2v5qslBRmM5+pmAESJq-----END CERTIFICATE-----"
    }
  ]
}
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 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
#inventories
Name Type Description Starting Version
name String The resource name. 0.6
uuid String The resource UUID. 0.6
certificate String The certificate. 2.3.2
description String The detailed description of the resource. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
listeners List See listeners. 0.6
#listeners
Name Type Description Starting Version
id Long 2.3.2
listenerUuid String 0.6
certificateUuid String 2.3.2
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

SDK Sample

Java SDK
QueryCertificateAction action = new QueryCertificateAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryCertificateAction.Result res = action.call();
Python SDK
QueryCertificateAction action = QueryCertificateAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryCertificateAction.Result res = action.call()

AddCertificateToLoadBalancerListener

API Request

URLs
POST zstack/v1/load-balancers/listeners/{listenerUuid}/certificate
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "certificateUuid": "707589c97d89315691794dbdadb1252f"
  },
  "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":{"certificateUuid":"707589c97d89315691794dbdadb1252f"}}' \
http://localhost:8080/zstack/v1/load-balancers/listeners/706687a8f42538e99a8519b9cbd61440/certificate
Request Parameters
Name Type Location Description Optional Value Starting Version
certificateUuid String body (contained in the params structure) 2.3.2
listenerUuid String url 2.3.2
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample Response
{
  "inventory": {
    "name": "Test-Lb-Listener",
    "loadBalancerUuid": "5f6148b3eafc37e59a6cfcb30f3bd8b8",
    "vmNicRefs": [
      {
        "listenerUuid": "5f6148b3eafc37e59a6cfcb30f3bd8b8",
        "vmNicUuid": "202ca851ff3e30d0b43a6176008a7bed"
      }
    ],
    "certificateRefs": [
      {
        "listenerUuid": "5f6148b3eafc37e59a6cfcb30f3bd8b8",
        "certificateUuid": "fb20f7baabb93cc9a2e0e713c5dfd870"
      }
    ]
  }
}
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 LoadBalancerListenerInventory See inventory. 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 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
#inventory
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. 2.3.2
#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.2
listenerUuid String 2.3.2
certificateUuid String 2.3.2
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

SDK Sample

Java SDK
AddCertificateToLoadBalancerListenerAction action = new AddCertificateToLoadBalancerListenerAction();
action.certificateUuid = "707589c97d89315691794dbdadb1252f";
action.listenerUuid = "706687a8f42538e99a8519b9cbd61440";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddCertificateToLoadBalancerListenerAction.Result res = action.call();
Python SDK
AddCertificateToLoadBalancerListenerAction action = AddCertificateToLoadBalancerListenerAction()
action.certificateUuid = "707589c97d89315691794dbdadb1252f"
action.listenerUuid = "706687a8f42538e99a8519b9cbd61440"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddCertificateToLoadBalancerListenerAction.Result res = action.call()

RemoveCertificateFromLoadBalancerListener

API Request

URLs
DELETE zstack/v1/load-balancers/listeners/{listenerUuid}/certificate
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/load-balancers/listeners/7b49bf59591335e8a9e3aa35c0949c0a/certificate
Request Parameters
Name Type Location Description Optional Value Starting Version
certificateUuid String body 2.3.2
listenerUuid String url 2.3.2
systemTags List body Optional. The system tags. 2.3.2
userTags List body Optional. The user tags. 2.3.2

API Response

Sample Response
{
  "inventory": {
    "name": "Test-Lb-Listener",
    "loadBalancerUuid": "12c0b22525323a3d98d77a0fc722dfe6",
    "vmNicRefs": [
      {
        "listenerUuid": "12c0b22525323a3d98d77a0fc722dfe6",
        "vmNicUuid": "e1fffed46c7c329ea08eef0cf3162319"
      }
    ]
  }
}
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 LoadBalancerListenerInventory See inventory. 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 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
#inventory
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.2
listenerUuid String 2.3.2
certificateUuid String 2.3.2
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

SDK Sample

Java SDK
RemoveCertificateFromLoadBalancerListenerAction action = new RemoveCertificateFromLoadBalancerListenerAction();
action.certificateUuid = "ae54af269496365d99c558a7f4137a6c";
action.listenerUuid = "7b49bf59591335e8a9e3aa35c0949c0a";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveCertificateFromLoadBalancerListenerAction.Result res = action.call();
Python SDK
RemoveCertificateFromLoadBalancerListenerAction action = RemoveCertificateFromLoadBalancerListenerAction()
action.certificateUuid = "ae54af269496365d99c558a7f4137a6c"
action.listenerUuid = "7b49bf59591335e8a9e3aa35c0949c0a"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveCertificateFromLoadBalancerListenerAction.Result res = action.call()

UpdateCertificate

API Request

URLs
PUT zstack/v1/certificates/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateCertificate": {
    "name": "Test-Cer",
    "description": "info"
  },
  "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 PUT -d '{"updateCertificate":{"name":"Test-Cer","description":"info"}}' \
http://localhost:8080/zstack/v1/certificates/e7fbc0a186d838f7b6fb0ae5133300ec/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
name String body (contained in the updateCertificate structure) Optional. Th resource name. 0.6
description String body (contained in the updateCertificate structure) Optional. The detailed description of the resource. 0.6
resourceUuid String body (contained in the updateCertificate structure) Optional. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample Response
{
  "inventory": {
    "name": "Test-Cer",
    "certificate": "123456789",
    "description": "Certificate for lb"
  }
}
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 CertificateInventory See inventory. 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 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
#inventory
Name Type Description Starting Version
name String The resource name. 0.6
uuid String The resource UUID. 0.6
certificate String The certificate. 0.6
description String The detailed description of the resource. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
listeners List See listeners. 2.3
#listeners
Name Type Description Starting Version
id Long 2.3.2
listenerUuid String 2.3
certificateUuid String 2.3.2
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

SDK Sample

Java SDK
UpdateCertificateAction action = new UpdateCertificateAction();
action.uuid = "e7fbc0a186d838f7b6fb0ae5133300ec";
action.name = "Test-Cer";
action.description = "info";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateCertificateAction.Result res = action.call();
Python SDK
UpdateCertificateAction action = UpdateCertificateAction()
action.uuid = "e7fbc0a186d838f7b6fb0ae5133300ec"
action.name = "Test-Cer"
action.description = "info"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateCertificateAction.Result res = action.call()

AddAccessControlListRedirectRule

API Request

URLs
POST zstack/v1/access-control-lists/{aclUuid}/redirectRules
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "redirect-rule",
    "domain": "zstack.io",
    "url": "/cloud"
  },
  "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":"redirect-rule","domain":"zstack.io","url":"/cloud"}}' http://localhost:8080/zstack/v1/access-control-lists/f1ca42b8901833fbac7cbd06e3b4d7cb/redirectRules
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) Optional. The resource name. 4.1.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 4.1.0
domain String body (contained in the params structure) Optional. The domain name. 4.1.0
url String body (contained in the params structure) Optional. The URL. 4.1.0
aclUuid String url The UUID of the access control list. 4.1.0
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 4.1.0
tagUuids List body (contained in the params structure) Optional. The tag UUID list. 4.1.0
systemTags List body Optional. The system tags. 4.1.0
userTags List body Optional. The user tags. 4.1.0

API Response

Sample Response
{
  "inventory": {
    "aclUuid": "3e05577ffa823e759d67e112aa7e5f80",
    "ipEntries": "192.168.48.0/24"
  }
}
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.1.0
inventory AccessControlListEntryInventory See inventory. 4.1.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.1.0
description String The brief description of the error. 4.1.0
details String The details about the error. 4.1.0
elaboration String The reserved field. Default value: null. 4.1.0
opaque LinkedHashMap The reserved field. Default value: null. 4.1.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.1.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 4.1.0
aclUuid String 4.1.0
type String 4.1.0
name String The resource name. 4.1.0
domain String 4.1.0
url String 4.1.0
ipEntries String 4.1.0
description String The detailed description of the resource. 4.1.0
createDate Timestamp The creation date. 4.1.0
lastOpDate Timestamp The last operation date. 4.1.0

SDK Sample

Java SDK
AddAccessControlListRedirectRuleAction action = new AddAccessControlListRedirectRuleAction();
action.name = "redirect-rule";
action.domain = "zstack.io";
action.url = "/cloud";
action.aclUuid = "f1ca42b8901833fbac7cbd06e3b4d7cb";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddAccessControlListRedirectRuleAction.Result res = action.call();
Python SDK
AddAccessControlListRedirectRuleAction action = AddAccessControlListRedirectRuleAction()
action.name = "redirect-rule"
action.domain = "zstack.io"
action.url = "/cloud"
action.aclUuid = "f1ca42b8901833fbac7cbd06e3b4d7cb"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddAccessControlListRedirectRuleAction.Result res = action.call()

ChangeAccessControlListRedirectRule

API Request

URLs
POST zstack/v1/access-control-lists/redirectRules/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeAccessControlListRedirectRule": {
    "name": "acl-group"
  },
  "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 PUT -d '{"changeAccessControlListRedirectRule":{"name":"acl-group"}}' http://localhost:8080/zstack/v1/access-control-lists/redirectRules/e58d9a2195c432fda747f33a884028ed/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 4.1.0
name String body (contained in the changeAccessControlListRedirectRule structure) Optional. The name of the forwarding rule. 4.1.0
systemTags List body Optional. The system tags. 4.1.0
userTags List body Optional. The user tags. 4.1.0

API Response

Sample Response
{
  "inventory": {
    "aclUuid": "bc9854edd56938f59a7ad06d2ffddb77",
    "type": "RedirectRule",
    "name": "acl-group",
    "domain": "zstack.io",
    "url": "/test"
  }
}
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.1.0
inventory AccessControlListEntryInventory See inventory. 4.1.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.1.0
description String The brief description of the error. 4.1.0
details String The details about the error. 4.1.0
elaboration String The reserved field. Default value: null. 4.1.0
opaque LinkedHashMap The reserved field. Default value: null. 4.1.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.1.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 4.1.0
aclUuid String 4.1.0
type String 4.1.0
name String The resource name. 4.1.0
domain String 4.1.0
url String 4.1.0
ipEntries String 4.1.0
description String The detailed description of the resource. 4.1.0
createDate Timestamp The creation date. 4.1.0
lastOpDate Timestamp The last operation date. 4.1.0

SDK Sample

Java SDK
ChangeAccessControlListRedirectRuleAction action = new ChangeAccessControlListRedirectRuleAction();
action.uuid = "e58d9a2195c432fda747f33a884028ed";
action.name = "acl-group";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeAccessControlListRedirectRuleAction.Result res = action.call();
Python SDK
ChangeAccessControlListRedirectRuleAction action = ChangeAccessControlListRedirectRuleAction()
action.uuid = "e58d9a2195c432fda747f33a884028ed"
action.name = "acl-group"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeAccessControlListRedirectRuleAction.Result res = action.call()

ChangeAccessControlListServerGroup

API Request

URLs
POST zstack/v1/load-balancers/listener/acl/{aclUuid}/servergroup/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeAccessControlListServerGroup": {
    "serverGroupUuids": [
      "89bdb613cad93f5f881b9127986d4d1b"
    ],
    "listenerUuid": "e58cd2cd6a633f999909c7e5ce448e07"
  },
  "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 PUT -d '{"changeAccessControlListServerGroup":{"serverGroupUuids":["89bdb613cad93f5f881b9127986d4d1b"],"listenerUuid":"e58cd2cd6a633f999909c7e5ce448e07"}}' http://localhost:8080/zstack/v1/load-balancers/listener/acl/07f904e5fbc8312992dd85a99c8edc9b/servergroup/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
serverGroupUuids List body (contained in the changeAccessControlListServerGroup structure) The UUID of the load balancer server group. 4.1.0
listenerUuid String body (contained in the changeAccessControlListServerGroup structure) The UUID of the listener. 4.1.0
aclUuid String url The UUID of the access control list. 4.1.0
systemTags List body Optional. The system tags. 4.1.0
userTags List body Optional. The user tags. 4.1.0

API Response

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"
	}
}

SDK Sample

Java SDK
ChangeAccessControlListServerGroupAction action = new ChangeAccessControlListServerGroupAction();
action.serverGroupUuids = asList("89bdb613cad93f5f881b9127986d4d1b");
action.listenerUuid = "e58cd2cd6a633f999909c7e5ce448e07";
action.aclUuid = "07f904e5fbc8312992dd85a99c8edc9b";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeAccessControlListServerGroupAction.Result res = action.call();
Python SDK
ChangeAccessControlListServerGroupAction action = ChangeAccessControlListServerGroupAction()
action.serverGroupUuids = [89bdb613cad93f5f881b9127986d4d1b]
action.listenerUuid = "e58cd2cd6a633f999909c7e5ce448e07"
action.aclUuid = "07f904e5fbc8312992dd85a99c8edc9b"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeAccessControlListServerGroupAction.Result res = action.call()

GetLoadBalancerListenerACLEntries

API Request

URLs
POST zstack/v1/load-balancers/listeners/access-control-lists/entries
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/load-balancers/listeners/access-control-lists/entries
Request Parameters
Name Type Location Description Optional Value Starting Version
listenerUuids List query Optional. The listener UUID. 4.1.0
type String query Optional. The type. 4.1.0
systemTags List query Optional. The system tags. 4.1.0
userTags List query Optional. The user tags. 4.1.0

API Response

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"
	}
}

SDK Sample

Java SDK
GetLoadBalancerListenerACLEntriesAction action = new GetLoadBalancerListenerACLEntriesAction();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetLoadBalancerListenerACLEntriesAction.Result res = action.call();
Python SDK
GetLoadBalancerListenerACLEntriesAction action = GetLoadBalancerListenerACLEntriesAction()
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetLoadBalancerListenerACLEntriesAction.Result res = action.call()

CreateAccessControlList

API Request

URLs
POST zstack/v1/access-control-lists
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "acl-group",
    "ipVersion": 4.0
  },
  "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":"acl-group","ipVersion":4.0}}' http://localhost:8080/zstack/v1/access-control-lists
Request Parameters
Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) The resource name. 3.9.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 3.9.0
ipVersion Integer body (contained in the params structure) Optional. The IP version.
  • 4
  • 6
3.9.0
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 3.9.0
tagUuids List body (contained in the params structure) Optional. The tag UUID list. 3.9.0
systemTags List body Optional. The system tags. 3.9.0
userTags List body Optional. The user tags. 3.9.0

API Response

Sample Response
{
  "inventory": {
    "name": "acl-group",
    "ipVersion": 4.0
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.9.0
inventory AccessControlListInventory See inventory. 3.9.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. 3.9.0
description String The brief description of the error. 3.9.0
details String The details about the error. 3.9.0
elaboration String The reserved field. Default value: null. 3.9.0
opaque LinkedHashMap The reserved field. Default value: null. 3.9.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. 3.9.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
name String The resource name. 3.9.0
ipVersion Integer The IP version. 3.9.0
description String The detailed description of the resource. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
entries List See entries. 3.9.0
#entries
Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
aclUuid String The UUID of the access control list. 3.9.0
ipEntries String The IP entries. 3.9.0
description String The detailed description of the resource. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0

SDK Sample

Java SDK
CreateAccessControlListAction action = new CreateAccessControlListAction();
action.name = "acl-group";
action.ipVersion = 4.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateAccessControlListAction.Result res = action.call();
Python SDK
CreateAccessControlListAction action = CreateAccessControlListAction()
action.name = "acl-group"
action.ipVersion = 4.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateAccessControlListAction.Result res = action.call()

DeleteAccessControlList

API Request

URLs
DELETE zstack/v1/access-control-lists/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/access-control-lists/f2a128d702d83f4389ad82d425b0e74e
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 3.9.0
deleteMode String body Optional. The delete mode. Options: Permissive | Enforcing. Default mode: Permissive. 3.9.0
systemTags List body Optional. The system tags. 3.9.0
userTags List body Optional. The user tags. 3.9.0

API Response

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"
	}
}

SDK Sample

Java SDK
DeleteAccessControlListAction action = new DeleteAccessControlListAction();
action.uuid = "f2a128d702d83f4389ad82d425b0e74e";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteAccessControlListAction.Result res = action.call();
Python SDK
DeleteAccessControlListAction action = DeleteAccessControlListAction()
action.uuid = "f2a128d702d83f4389ad82d425b0e74e"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteAccessControlListAction.Result res = action.call()

QueryAccessControlList

API Request

URLs
GET zstack/v1/access-control-lists
GET zstack/v1/access-control-lists/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/access-control-lists
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/access-control-lists/83146a1d0dd93c6abc53788a6434bd57

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryAccessControlList, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "0abdbd20b8173ccf89f881309b5e40d0",
      "name": "acl-group"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.9.0
inventories List See inventories. 3.9.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. 3.9.0
description String The brief description of the error. 3.9.0
details String The details about the error. 3.9.0
elaboration String The reserved field. Default value: null. 3.9.0
opaque LinkedHashMap The reserved field. Default value: null. 3.9.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. 3.9.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
name String The resource name. 3.9.0
ipVersion Integer The IP version. 3.9.0
description String The detailed description of the resource. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
entries List See entries. 3.9.0
#entries
Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
aclUuid String The UUID of the access control list. 3.9.0
ipEntries String The IP entries. 3.9.0
description String The detailed description of the resource. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0

SDK Sample

Java SDK
QueryAccessControlListAction action = new QueryAccessControlListAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryAccessControlListAction.Result res = action.call();
Python SDK
QueryAccessControlListAction action = QueryAccessControlListAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryAccessControlListAction.Result res = action.call()

AddAccessControlListEntry

API Request

URLs
POST zstack/v1/access-control-lists/{aclUuid}/ipentries
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "entries": "192.168.12.1,192.168.48.0/24"
  },
  "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":{"entries":"192.168.12.1,192.168.48.0/24"}}' http://localhost:8080/zstack/v1/access-control-lists/101a39fcb6c538a4914d0ae7fa8468a4/ipentries
Request Parameters
Name Type Location Description Optional Value Starting Version
aclUuid String url The UUID of the access control list. 3.9.0
entries String body (contained in the params structure) The IP entries. 3.9.0
description String body (contained in the params structure) Optional. The detailed description of the resource. 3.9.0
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 3.9.0
tagUuids List body (contained in the params structure) Optional. The tag UUID list. 3.9.0
systemTags List body Optional. The system tags. 3.9.0
userTags List body Optional. The user tags. 3.9.0

API Response

Sample Response
{
  "inventory": {
    "aclUuid": "3e05577ffa823e759d67e112aa7e5f80",
    "ipEntries": "192.168.48.0/24"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.9.0
inventory AccessControlListEntryInventory See inventory. 3.9.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. 3.9.0
description String The brief description of the error. 3.9.0
details String The details about the error. 3.9.0
elaboration String The reserved field. Default value: null. 3.9.0
opaque LinkedHashMap The reserved field. Default value: null. 3.9.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. 3.9.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
aclUuid String The UUID of the access control list. 3.9.0
ipEntries String The IP entries. 3.9.0
description String The detailed description of the resource. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0

SDK Sample

Java SDK
AddAccessControlListEntryAction action = new AddAccessControlListEntryAction();
action.aclUuid = "101a39fcb6c538a4914d0ae7fa8468a4";
action.entries = "192.168.12.1,192.168.48.0/24";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddAccessControlListEntryAction.Result res = action.call();
Python SDK
AddAccessControlListEntryAction action = AddAccessControlListEntryAction()
action.aclUuid = "101a39fcb6c538a4914d0ae7fa8468a4"
action.entries = "192.168.12.1,192.168.48.0/24"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddAccessControlListEntryAction.Result res = action.call()

RemoveAccessControlListEntry

API Request

URLs
DELETE zstack/v1/access-control-lists/{aclUuid}/ipentries/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/access-control-lists/c151f0f90e143c26b6667e70ebbe5b7b/ipentries/22c9d1f964b63f6abc52fed8437042a3
Request Parameters
Name Type Location Description Optional Value Starting Version
aclUuid String url The UUID of the access control list. 3.9.0
uuid String url The resource UUID. 3.9.0
deleteMode String body Optional. The delete mode. Options: Permissive | Enforcing. Default mode: Permissive. 3.9.0
systemTags List body Optional. The system tags. 3.9.0
userTags List body Optional. The user tags. 3.9.0

API Response

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"
	}
}

SDK Sample

Java SDK
RemoveAccessControlListEntryAction action = new RemoveAccessControlListEntryAction();
action.aclUuid = "c151f0f90e143c26b6667e70ebbe5b7b";
action.uuid = "22c9d1f964b63f6abc52fed8437042a3";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveAccessControlListEntryAction.Result res = action.call();
Python SDK
RemoveAccessControlListEntryAction action = RemoveAccessControlListEntryAction()
action.aclUuid = "c151f0f90e143c26b6667e70ebbe5b7b"
action.uuid = "22c9d1f964b63f6abc52fed8437042a3"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveAccessControlListEntryAction.Result res = action.call()

AddAccessControlListToLoadBalancer

API Request

URLs
POST zstack/v1/load-balancers/listeners/{listenerUuid}/access-control-lists
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "aclUuids": [
      "25e10ecdb6d63b598899c1103d2cdf46"
    ],
    "aclType": "black"
  },
  "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":{"aclUuids":["25e10ecdb6d63b598899c1103d2cdf46"],"aclType":"black"}}' http://localhost:8080/zstack/v1/load-balancers/listeners/19c1a4dcaea637da86e3ecbb6a3a5f6e/access-control-lists
Request Parameters
Name Type Location Description Optional Value Starting Version
aclUuids List body (contained in the params structure) The UUID of the access control list. 3.9.0
aclType String body (contained in the params structure) The access control type.
  • white
  • black
3.9.0
listenerUuid String url The listener UUID. 3.9.0
serverGroupUuids List body Optional. The UUID of the load balancer server group. 4.1.0
systemTags List body Optional. The system tags. 3.9.0
userTags List body Optional. The user tags. 3.9.0

API Response

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"
	}
}

SDK Sample

Java SDK
AddAccessControlListToLoadBalancerAction action = new AddAccessControlListToLoadBalancerAction();
action.aclUuids = asList("25e10ecdb6d63b598899c1103d2cdf46");
action.aclType = "black";
action.listenerUuid = "19c1a4dcaea637da86e3ecbb6a3a5f6e";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddAccessControlListToLoadBalancerAction.Result res = action.call();
Python SDK
AddAccessControlListToLoadBalancerAction action = AddAccessControlListToLoadBalancerAction()
action.aclUuids = [25e10ecdb6d63b598899c1103d2cdf46]
action.aclType = "black"
action.listenerUuid = "19c1a4dcaea637da86e3ecbb6a3a5f6e"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddAccessControlListToLoadBalancerAction.Result res = action.call()

RemoveAccessControlListFromLoadBalancer

API Request

URLs
DELETE zstack/v1/load-balancers/listeners/{listenerUuid}/access-control-lists
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/load-balancers/listeners/0299b3e26af5350c8db91930723d2065/access-control-lists
Request Parameters
Name Type Location Description Optional Value Starting Version
aclUuids List body The UUID of the access control list. 3.9.0
listenerUuid String url The listener UUID. 3.9.0
serverGroupUuids List body Optional. The UUID of the load balancer server group. 4.1.0
systemTags List body Optional. The system tags. 3.9.0
userTags List body Optional. The user tags. 3.9.0

API Response

Sample Response
{
  "inventory": {
    "uuid": "fb39937eaf5b3564af4b23d48802d438",
    "name": "test-lb-listener"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.9.0
inventory LoadBalancerListenerInventory See inventory. 3.9.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. 3.9.0
description String The brief description of the error. 3.9.0
details String The details about the error. 3.9.0
elaboration String The reserved field. Default value: null. 3.9.0
opaque LinkedHashMap The reserved field. Default value: null. 3.9.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. 3.9.0
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
name String The resource name. 3.9.0
description String The detailed description of the resource. 3.9.0
loadBalancerUuid String The load balancer UUID. 3.9.0
instancePort Integer 3.9.0
loadBalancerPort Integer 3.9.0
protocol String 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
vmNicRefs List See vmNicRefs. 3.9.0
aclRefs List See aclRefs. 3.9.0
certificateRefs List See certificateRefs. 3.9.0
serverGroupRefs List See serverGroupRefs. 4.1.0
#vmNicRefs
Name Type Description Starting Version
id Long 3.9.0
listenerUuid String 3.9.0
vmNicUuid String The VM NIC UUID. 3.9.0
status String 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
#aclRefs
Name Type Description Starting Version
id Long The resource UUID. 3.9.0
listenerUuid String The listener UUID. 3.9.0
aclUuid String The UUID of the access control list. 3.9.0
type String The access control type. 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
#certificateRefs
Name Type Description Starting Version
id Long 3.9.0
listenerUuid String 3.9.0
certificateUuid String 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
#serverGroupRefs
Name Type Description Starting Version
id Long 4.1.0
listenerUuid String 4.1.0
serverGroupUuid String 4.1.0
createDate Timestamp The creation date. 4.1.0
lastOpDate Timestamp The last operation date. 4.1.0

SDK Sample

Java SDK
RemoveAccessControlListFromLoadBalancerAction action = new RemoveAccessControlListFromLoadBalancerAction();
action.aclUuids = asList("027bfcc0fddf39e3be51badf4777c0cd");
action.listenerUuid = "0299b3e26af5350c8db91930723d2065";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveAccessControlListFromLoadBalancerAction.Result res = action.call();
Python SDK
RemoveAccessControlListFromLoadBalancerAction action = RemoveAccessControlListFromLoadBalancerAction()
action.aclUuids = [027bfcc0fddf39e3be51badf4777c0cd]
action.listenerUuid = "0299b3e26af5350c8db91930723d2065"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveAccessControlListFromLoadBalancerAction.Result res = action.call()

GetCandidateL3NetworksForLoadBalancer

API Request

URLs
GET zstack/v1/load-balancers/listeners/{listenerUuid}/networks/candidates
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/load-balancers/listeners/6ecc19bdec0139499e3abf6c51bca683/networks/candidates?limit=1000.0&start=0.0
Request Parameters
Name Type Location Description Optional Value Starting Version
listenerUuid String url 3.9.0
limit Integer query Optional. 3.9.0
start Integer query Optional. 3.9.0
systemTags List query Optional. The system tags. 3.9.0
userTags List query Optional. The user tags. 3.9.0

API Response

Sample Response
{
  "inventories": [
    {
      "name": "Test-L3Network",
      "l2NetworkUuid": "7631f86a65af335fb1496afe8e7ac9ee"
    }
  ]
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 3.9.0
inventories List See inventories. 3.9.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. 3.9.0
description String The brief description of the error. 3.9.0
details String The details about the error. 3.9.0
elaboration String The reserved field. Default value: null. 3.9.0
opaque LinkedHashMap The reserved field. Default value: null. 3.9.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. 3.9.0
#inventories
Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
name String The resource name. 3.9.0
description String The detailed description of the resource. 3.9.0
type String 3.9.0
zoneUuid String The zone UUID. 3.9.0
l2NetworkUuid String The L2 network UUID. 3.9.0
state String 3.9.0
dnsDomain String 3.9.0
system Boolean 3.9.0
category String 3.9.0
ipVersion Integer 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
dns List 3.9.0
ipRanges List See ipRanges. 3.9.0
networkServices List See networkServices. 3.9.0
hostRoute List See hostRoute. 3.9.0
#ipRanges
Name Type Description Starting Version
uuid String The resource UUID. 3.9.0
l3NetworkUuid String The L3 network UUID. 3.9.0
name String The resource name. 3.9.0
description String The detailed description of the resource. 3.9.0
startIp String 3.9.0
endIp String 3.9.0
netmask String 3.9.0
gateway String 3.9.0
networkCidr String 3.9.0
ipVersion Integer 3.9.0
addressMode String 3.9.0
prefixLen Integer 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0
#networkServices
Name Type Description Starting Version
l3NetworkUuid String The L3 network UUID. 3.9.0
networkServiceProviderUuid String The UUID of the network service provider. 3.9.0
networkServiceType String 3.9.0
#hostRoute
Name Type Description Starting Version
id Long 3.9.0
l3NetworkUuid String The L3 network UUID. 3.9.0
prefix String 3.9.0
nexthop String 3.9.0
createDate Timestamp The creation date. 3.9.0
lastOpDate Timestamp The last operation date. 3.9.0

SDK Sample

Java SDK
GetCandidateL3NetworksForLoadBalancerAction action = new GetCandidateL3NetworksForLoadBalancerAction();
action.listenerUuid = "6ecc19bdec0139499e3abf6c51bca683";
action.limit = 1000.0;
action.start = 0.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateL3NetworksForLoadBalancerAction.Result res = action.call();
Python SDK
GetCandidateL3NetworksForLoadBalancerAction action = GetCandidateL3NetworksForLoadBalancerAction()
action.listenerUuid = "6ecc19bdec0139499e3abf6c51bca683"
action.limit = 1000.0
action.start = 0.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidateL3NetworksForLoadBalancerAction.Result res = action.call()

CreateLoadBalancerServerGroup

API Request

URLs
POST zstack/v1/load-balancers/{loadBalancerUuid}/servergroups
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "create-Lb"
  },
  "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":"create-Lb"}}' http://localhost:8080/zstack/v1/load-balancers/7cac70b63aad32dda436e95bba3c34cb/servergroups
Request Parameters
Name Type Location Description Valid Value Starting Version
name String body(contained in the params structure) The name of the server group for load balancing. 4.0.0
description String body(contained in the params structure) Optional. The detailed description of the server group. 4.0.0
loadBalancerUuid String url The load balancer UUID. 4.0.0
resourceUuid String body(contained in the params structure) Optional. The UUID of the server group. 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

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"
	}
}

SDK Sample

Java SDK
CreateLoadBalancerServerGroupAction action = new CreateLoadBalancerServerGroupAction();
action.name = "create-Lb";
action.loadBalancerUuid = "7cac70b63aad32dda436e95bba3c34cb";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateLoadBalancerServerGroupAction.Result res = action.call();
Python SDK
CreateLoadBalancerServerGroupAction action = CreateLoadBalancerServerGroupAction()
action.name = "create-Lb"
action.loadBalancerUuid = "7cac70b63aad32dda436e95bba3c34cb"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateLoadBalancerServerGroupAction.Result res = action.call()

DeleteLoadBalancerServerGroup

API Request

URLs
DELETE zstack/v1/load-balancers/servergroups/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/load-balancers/servergroups/1e1fef3a79563c1080210f094ea62898?deleteMode=Permissive
Request Parameters
Name Type Location Description Valid Value Starting Version
uuid String url The UUID of the server group. 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

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"
	}
}

SDK Sample

Java SDK
DeleteLoadBalancerServerGroupAction action = new DeleteLoadBalancerServerGroupAction();
action.uuid = "1e1fef3a79563c1080210f094ea62898";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteLoadBalancerServerGroupAction.Result res = action.call();
Python SDK
DeleteLoadBalancerServerGroupAction action = DeleteLoadBalancerServerGroupAction()
action.uuid = "1e1fef3a79563c1080210f094ea62898"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteLoadBalancerServerGroupAction.Result res = action.call()

UpdateLoadBalancerServerGroup

API Request

URLs
PUT zstack/v1/load-balancers/servergroups/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateLoadBalancerServerGroup": {
    "name": "updateServerGroup",
    "description": "updateServerGroup"
  },
  "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 PUT -d '{"updateLoadBalancerServerGroup":{"name":"updateServerGroup","description":"updateServerGroup"}}' http://localhost:8080/zstack/v1/load-balancers/servergroups/e29a3b43310933718221e4c314c8af6f/actions
Request Parameters
Name Type Location Description Valid Value Starting Version
uuid String url The resource UUID. 4.0.0
name String body(contained in the updateLoadBalancerServerGroup structure) Optional. The resource name. 4.0.0
description String body(contained in the updateLoadBalancerServerGroup structure) Optional. The detailed description of the resource. 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

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"
	}
}

SDK Sample

Java SDK
UpdateLoadBalancerServerGroupAction action = new UpdateLoadBalancerServerGroupAction();
action.uuid = "e29a3b43310933718221e4c314c8af6f";
action.name = "updateServerGroup";
action.description = "updateServerGroup";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateLoadBalancerServerGroupAction.Result res = action.call();
Python SDK
UpdateLoadBalancerServerGroupAction action = UpdateLoadBalancerServerGroupAction()
action.uuid = "e29a3b43310933718221e4c314c8af6f"
action.name = "updateServerGroup"
action.description = "updateServerGroup"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateLoadBalancerServerGroupAction.Result res = action.call()

QueryLoadBalancerServerGroup

API Request

URLs
GET zstack/v1/load-balancers/servergroups
GET zstack/v1/load-balancers/servergroups/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/load-balancers/servergroups
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/load-balancers/servergroups/3d12c68915bd391ca7cea7a95249b47b

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryLoadBalancerServerGroup, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "f523d90c41b136279b523052149c9690",
      "name": "Test-LbServerGroup"
    }
  ]
}
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
inventories List See inventories. 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
#inventories
Name Type Description Starting Version
uuid String The UUID of the server group. 4.0.0
name String The name of the server group. 4.0.0
description String The detailed description of the server group. 4.0.0
loadBalancerUuid String The load balancer UUID. 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
listenerServerGroupRefs List See listenerServerGroupRefs. 4.0.0
serverIps List See serverIps. 4.0.0
vmNicRefs List See vmNicRefs. 4.0.0
#listenerServerGroupRefs
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 listener was created. 4.0.0
lastOpDate Timestamp The time when the listener was last modified. 4.0.0
#serverIps
Name Type Description Starting Version
id long 4.0.0
description String The detailed description of the IP address. 4.0.0
serverGroupUuid String 4.0.0
ipAddress String 4.0.0
weight Long 4.0.0
status String 4.0.0
createDate Timestamp The time when the was used. 4.0.0
lastOpDate Timestamp The time when the was last modified. 4.0.0
#vmNicRefs
Name Type Description Starting Version
id Long 4.0.0
serverGroupUuid String 4.0.0
vmNicUuid String The VM NIC UUID. 4.0.0
weight Long 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

SDK Sample

Java SDK
QueryLoadBalancerServerGroupAction action = new QueryLoadBalancerServerGroupAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryLoadBalancerServerGroupAction.Result res = action.call();
Python SDK
QueryLoadBalancerServerGroupAction action = QueryLoadBalancerServerGroupAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryLoadBalancerServerGroupAction.Result res = action.call()

AddBackendServerToServerGroup

API Request

URLs
POST zstack/v1/load-balancers/servergroups/{serverGroupUuid}/backendservers
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "vmNics": [
      {
        "70856dd6ee693c30b28e6233850fc494": "10"
      }
    ],
    "servers": [
      {
        "192.168.1.1": "20"
      }
    ]
  },
  "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":{"vmNics":[{"70856dd6ee693c30b28e6233850fc494":"10"}],"servers":[{"192.168.1.1":"20"}]}}' http://localhost:8080/zstack/v1/load-balancers/servergroups/9e9c1f7a74ce3cb6b51d4f938537f765/backendservers
Request Parameters
Name Type Location Description Valid Value Starting Version
serverGroupUuid String url The UUID of the server group for load balancing. 4.0.0
vmNics List body(contained in the params structure) Optional. The NIC of the backend server. 4.0.0
servers List body(contained in the params structure) Optional. The IP address of the backend server. 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
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
AddBackendServerToServerGroupAction action = new AddBackendServerToServerGroupAction();
action.serverGroupUuid = "9e9c1f7a74ce3cb6b51d4f938537f765";
action.vmNics = asList([70856dd6ee693c30b28e6233850fc494:10]);
action.servers = asList([192.168.1.1:20]);
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddBackendServerToServerGroupAction.Result res = action.call();
Python SDK
AddBackendServerToServerGroupAction action = AddBackendServerToServerGroupAction()
action.serverGroupUuid = "9e9c1f7a74ce3cb6b51d4f938537f765"
action.vmNics = [[70856dd6ee693c30b28e6233850fc494:10]]
action.servers = [[192.168.1.1:20]]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddBackendServerToServerGroupAction.Result res = action.call()

RemoveBackendServerFromServerGroup

API Request

URLs
PUT zstack/v1/load-balancers/servergroups/{serverGroupUuid}/backendservers/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "removeBackendServerFromServerGroup": {},
  "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 PUT -d '{"removeBackendServerFromServerGroup":{}}' http://localhost:8080/zstack/v1/load-balancers/servergroups/af07cb06004d35b6af53aa12c8438f22/backendservers/actions
Request Parameters
Name Type Location Description Valid Value Starting Version
serverGroupUuid String url 4.0.0
vmNicUuids List body(contained in the removeBackendServerFromServerGroup structure) Optional. 4.0.0
serverIps List body(contained in the removeBackendServerFromServerGroup structure) Optional. 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

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"
	}
}

SDK Sample

Java SDK
RemoveBackendServerFromServerGroupAction action = new RemoveBackendServerFromServerGroupAction();
action.serverGroupUuid = "af07cb06004d35b6af53aa12c8438f22";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveBackendServerFromServerGroupAction.Result res = action.call();
Python SDK
RemoveBackendServerFromServerGroupAction action = RemoveBackendServerFromServerGroupAction()
action.serverGroupUuid = "af07cb06004d35b6af53aa12c8438f22"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveBackendServerFromServerGroupAction.Result res = action.call()

AddServerGroupToLoadBalancerListener

API Request

URLs
POST zstack/v1/load-balancers/listeners/{listenerUuid}/servergroups
Headers
Authorization: OAuth the-session-uuid
Body
{
  "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/servergroups
Request 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()

RemoveServerGroupFromLoadBalancerListener

API Request

URLs
DELETE zstack/v1/load-balancers/listeners/{listenerUuid}/servergroups
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/load-balancers/listeners/f75607a7bf203e07bab135d9363bd17d/servergroups
Request Parameters
Name Type Location Description Valid Value Starting Version
serverGroupUuid String body The server group UUID. 4.0.0
listenerUuid String url The listener UUID. 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": "0938faf74f7d34cd97d35427b1b562e5",
    "name": "Test-Listener",
    "loadBalancerUuid": "e64028f4b3f33896a49d4da1d4e51a8f",
    "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 aclRefs. 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
#aclRefs
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
RemoveServerGroupFromLoadBalancerListenerAction action = new RemoveServerGroupFromLoadBalancerListenerAction();
action.serverGroupUuid = "f08184f0cda83505bc2a703b5e589160";
action.listenerUuid = "f75607a7bf203e07bab135d9363bd17d";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveServerGroupFromLoadBalancerListenerAction.Result res = action.call();
Python SDK
RemoveServerGroupFromLoadBalancerListenerAction action = RemoveServerGroupFromLoadBalancerListenerAction()
action.serverGroupUuid = "f08184f0cda83505bc2a703b5e589160"
action.listenerUuid = "f75607a7bf203e07bab135d9363bd17d"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
RemoveServerGroupFromLoadBalancerListenerAction.Result res = action.call()

ChangeLoadBalancerBackendServer

API Request

URLs
PUT zstack/v1/load-balancers/servergroups/{serverGroupUuid}/backendserver/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "changeLoadBalancerBackendServer": {
    "vmNics": [
      {
        "c1409d7fc54333d5ad3163d406620c01": "10"
      }
    ],
    "servers": [
      {
        "192.168.1.1": "20"
      }
    ]
  },
  "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 PUT -d '{"changeLoadBalancerBackendServer":{"vmNics":[{"c1409d7fc54333d5ad3163d406620c01":"10"}],"servers":[{"192.168.1.1":"20"}]}}' http://localhost:8080/zstack/v1/load-balancers/servergroups/892bcf49ff433372952a09db93f851e6/backendserver/actions
Request Parameters
Name Type Location Description Valid Value Starting Version
serverGroupUuid String url The UUID of the server group for load balancing. 4.0.0
vmNics List body(contained in the changeLoadBalancerBackendServer structure) Optional. The VM NICs. 4.0.0
servers List body(contained in the changeLoadBalancerBackendServer structure) Optional. The IP addresses of backend servers. 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

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"
	}
}

SDK Sample

Java SDK
ChangeLoadBalancerBackendServerAction action = new ChangeLoadBalancerBackendServerAction();
action.serverGroupUuid = "892bcf49ff433372952a09db93f851e6";
action.vmNics = asList([c1409d7fc54333d5ad3163d406620c01:10]);
action.servers = asList([192.168.1.1:20]);
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeLoadBalancerBackendServerAction.Result res = action.call();
Python SDK
ChangeLoadBalancerBackendServerAction action = ChangeLoadBalancerBackendServerAction()
action.serverGroupUuid = "892bcf49ff433372952a09db93f851e6"
action.vmNics = [[c1409d7fc54333d5ad3163d406620c01:10]]
action.servers = [[192.168.1.1:20]]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeLoadBalancerBackendServerAction.Result res = action.call()

GetCandidateVmNicsForLoadBalancerServerGroup

API Request

URLs
GET zstack/v1/load-balancers/servergroups/candidate-nics
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/load-balancers/servergroups/candidate-nics?servergroupUuid=8e19c3c1227635b39799ff85cd2e01b4&loadBalancerUuid=786271b7eea63f0785ed67e3a36bfe35
Request Parameters
Name Type Location Description Valid Value Starting Version
servergroupUuid String query Optional. The UUID of the server group. 4.0.0
loadBalancerUuid String query Optional. The load balancer UUID. 4.0.0
systemTags List query Optional. The system tags. 4.0.0
userTags List query Optional. The user tags. 4.0.0

API Response

Sample Response
{
  "inventories": [
    {
      "uuid": "798c7b209b34303aa9a48593594bccee",
      "vmInstanceUuid": "c158c92bdda63bbb97c8dea6d284350a",
      "usedIpUuid": "702b0b20aebe3d4a880abe851940462d",
      "l3NetworkUuid": "a1cebc14f5b236578049889964686822",
      "ip": "192.168.1.10",
      "mac": "00:0c:29:bd:99:fc",
      "hypervisorType": "KVM",
      "netmask": "255.255.255.0",
      "gateway": "192.168.1.1",
      "deviceId": 0.0,
      "createDate": "Nov 14, 2017 10:20:57 PM",
      "lastOpDate": "Nov 14, 2017 10:20:57 PM"
    }
  ]
}
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
inventories List See inventories. 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
#inventories
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 added to the VM instance. 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

SDK Sample

Java SDK
GetCandidateVmNicsForLoadBalancerServerGroupAction action = new GetCandidateVmNicsForLoadBalancerServerGroupAction();
action.servergroupUuid = "8e19c3c1227635b39799ff85cd2e01b4";
action.loadBalancerUuid = "786271b7eea63f0785ed67e3a36bfe35";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetCandidateVmNicsForLoadBalancerServerGroupAction.Result res = action.call();
Python SDK
GetCandidateVmNicsForLoadBalancerServerGroupAction action = GetCandidateVmNicsForLoadBalancerServerGroupAction()
action.servergroupUuid = "8e19c3c1227635b39799ff85cd2e01b4"
action.loadBalancerUuid = "786271b7eea63f0785ed67e3a36bfe35"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetCandidateVmNicsForLoadBalancerServerGroupAction.Result res = action.call()

CreateSlbGroup

API Request

URLs
POST zstack/v1/load-balancers/slb/groups
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "slbGroup",
    "slbOfferingUuid": "f66b4cd06a2d3ae985e40514502c3ea3",
    "frontEndL3NetworkUuid": "307ab51e198a35bab0bcc517f849aa46",
    "backendType": "VYOS",
    "deployType": "Direct",
    "description": "this is a slb spec 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":"slbGroup","slbOfferingUuid":"f66b4cd06a2d3ae985e40514502c3ea3","frontEndL3NetworkUuid":"307ab51e198a35bab0bcc517f849aa46","backendType":"VYOS","deployType":"Direct","description":"this is a slb spec for test"}}' http://localhost:8080/zstack/v1/load-balancers/slb/groups
Request 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
slbOfferingUuid String body(contained in the params structure) The UUID of the SLB offering. 4.0.0
frontEndL3NetworkUuid String body(contained in the params structure) The frontend L3 network UUID. 4.0.0
backendL3NetworkUuids List body(contained in the params structure) Optional. The backend L3 network UUID. 4.0.0
backendType String body(contained in the params structure) Optional. The backend type.
  • VYOS
4.0.0
deployType String body(contained in the params structure) Optional. The deployment type.
  • Direct
4.0.0
description String body(contained in the params structure) Optional. The detailed description of the SLB group. 4.0.0
resourceUuid String body(contained in the params structure) Optional. The UUID of the SLB group. 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": {}
}
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 SlbGroupInventory 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 SLB group. 4.0.0
name String The name of the SLB group. 4.0.0
backendType String 4.0.0
deployType String 4.0.0
slbOfferingUuid String 4.0.0
description String The detailed description of the SLB group. 4.0.0
createDate Timestamp The time when the SLB group was created. 4.0.0
lastOpDate Timestamp The time when the SLB group was last modified. 4.0.0
slbVms List See slbVms. 4.0.0
lbs List See lbs. 4.0.0
networks List See networks 4.0.0
#slbVms
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 VM UUID. 4.0.0
name String The name of the VM instance. 4.0.0
description String The detailed description of the VM 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 instance offering UUID. 4.0.0
rootVolumeUuid String The root volume UUID. 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 VM instance was created. 4.0.0
lastOpDate Timestamp The time when the VM 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 added to the VM instance. 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
#lbs
Name Type Description Starting Version
slbGroupUuid String 4.0.0
name String The name of the load balancer. 4.0.0
uuid String The UUID of the load balancer. 4.0.0
description String The detailed description of the load balancer. 4.0.0
state String 4.0.0
type String 4.0.0
vipUuid String The virtual IP UUID. 4.0.0
createDate Timestamp The time when the oad balancer was created. 4.0.0
lastOpDate Timestamp The time when the load balancer was last modified. 4.0.0
listeners List See listeners. 4.0.0
#listeners
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 aclRefs. 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
#aclRefs
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
#networks
Name Type Description Starting Version
slbGroupUuid String 4.0.0
l3NetworkUuid String The L3 network UUID. 4.0.0
l3NetworkCategory String 4.0.0
l3NetworkType String 4.0.0
type String 4.0.0
createDate Timestamp The time when the network was created. 4.0.0
lastOpDate Timestamp The time when the network was last modified. 4.0.0

SDK Sample

Java SDK
CreateSlbGroupAction action = new CreateSlbGroupAction();
action.name = "slbGroup";
action.slbOfferingUuid = "f66b4cd06a2d3ae985e40514502c3ea3";
action.frontEndL3NetworkUuid = "307ab51e198a35bab0bcc517f849aa46";
action.backendType = "VYOS";
action.deployType = "Direct";
action.description = "this is a slb spec for test";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSlbGroupAction.Result res = action.call();
Python SDK
CreateSlbGroupAction action = CreateSlbGroupAction()
action.name = "slbGroup"
action.slbOfferingUuid = "f66b4cd06a2d3ae985e40514502c3ea3"
action.frontEndL3NetworkUuid = "307ab51e198a35bab0bcc517f849aa46"
action.backendType = "VYOS"
action.deployType = "Direct"
action.description = "this is a slb spec for test"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSlbGroupAction.Result res = action.call()

DeleteSlbGroup

API Request

URLs
DELETE zstack/v1/load-balancers/slb/group/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/load-balancers/slb/group/d0b541dcd7d230378a0d97e6c1e07d48
Request Parameters
Name Type Location Description Valid Value Starting Version
uuid String url The UUID of the SLB group. 4.0.0
deleteMode String body Optional. The deletion mode.
  • Permissive
  • Enforcing
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

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"
	}
}

SDK Sample

Java SDK
DeleteSlbGroupAction action = new DeleteSlbGroupAction();
action.uuid = "d0b541dcd7d230378a0d97e6c1e07d48";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteSlbGroupAction.Result res = action.call();
Python SDK
DeleteSlbGroupAction action = DeleteSlbGroupAction()
action.uuid = "d0b541dcd7d230378a0d97e6c1e07d48"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteSlbGroupAction.Result res = action.call()

UpdateSlbGroup

API Request

URLs
PUT zstack/v1/load-balancers/slb/group/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "updateSlbGroup": {
    "name": "slb",
    "description": "slb test",
    "slbOfferingUuid": "3996416dcab833258087ac86be993858"
  },
  "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 PUT -d '{"updateSlbGroup":{"name":"slb","description":"slb test","slbOfferingUuid":"3996416dcab833258087ac86be993858"}}' http://localhost:8080/zstack/v1/load-balancers/slb/group/fa13412281f333469e8009c531ef9755/actions
Request Parameters
Name Type Location Description Valid Value Starting Version
uuid String url The UUID of the SLB group. 4.0.0
name String body(contained in the updateSlbGroup structure) Optional. The name of the SLB group. 4.0.0
description String body(contained in the updateSlbGroup structure) Optional. The detailed description of the SLB group. 4.0.0
slbOfferingUuid String body(contained in the updateSlbGroup structure) Optional. The UUID of the SLB offering. 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": "slb",
    "backendType": "vyos",
    "deployType": "direct",
    "description": "slb test"
  }
}
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 SlbGroupInventory 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 SLB group. 4.0.0
name String The name of the SLB group. 4.0.0
backendType String 4.0.0
deployType String 4.0.0
slbOfferingUuid String 4.0.0
description String The detailed description of the SLB group. 4.0.0
createDate Timestamp The time when the SLB group was created. 4.0.0
lastOpDate Timestamp The time when the SLB group was last modified. 4.0.0
slbVms List See slbVms. 4.0.0
lbs List See lbs. 4.0.0
networks List See networks. 4.0.0
#slbVms
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 VM UUID. 4.0.0
name String The name of the VM instance. 4.0.0
description String The detailed description of the VM 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 instance offering UUID. 4.0.0
rootVolumeUuid String The root volume UUID. 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 VM instance was created. 4.0.0
lastOpDate Timestamp The time when the VM 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 added to the VM instance. 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
#lbs
Name Type Description Starting Version
slbGroupUuid String 4.0.0
name String The name of the load balancer. 4.0.0
uuid String The UUID of the load balancer. 4.0.0
description String The detailed description of the load balancer. 4.0.0
state String 4.0.0
type String 4.0.0
vipUuid String The virtual IP UUID. 4.0.0
createDate Timestamp The time when the oad balancer was created. 4.0.0
lastOpDate Timestamp The time when the load balancer was last modified. 4.0.0
listeners List See listeners. 4.0.0
#listeners
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 aclRefs. 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
#aclRefs
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
#networks
Name Type Description Starting Version
slbGroupUuid String 4.0.0
l3NetworkUuid String The L3 network UUID. 4.0.0
l3NetworkCategory String 4.0.0
l3NetworkType String 4.0.0
type String 4.0.0
createDate Timestamp The time when the network was created. 4.0.0
lastOpDate Timestamp The time when the network was last modified. 4.0.0

SDK Sample

Java SDK
UpdateSlbGroupAction action = new UpdateSlbGroupAction();
action.uuid = "fa13412281f333469e8009c531ef9755";
action.name = "slb";
action.description = "slb test";
action.slbOfferingUuid = "3996416dcab833258087ac86be993858";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateSlbGroupAction.Result res = action.call();
Python SDK
UpdateSlbGroupAction action = UpdateSlbGroupAction()
action.uuid = "fa13412281f333469e8009c531ef9755"
action.name = "slb"
action.description = "slb test"
action.slbOfferingUuid = "3996416dcab833258087ac86be993858"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateSlbGroupAction.Result res = action.call()

QuerySlbGroup

API Request

URLs
GET zstack/v1/load-balancers/slb/groups
GET zstack/v1/load-balancers/slb/groups/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/load-balancers/slb/groups
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/load-balancers/slb/groups/3cdd853e3e8d364b83f6e1e4965df7b0

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QuerySlbGroup, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "name": "slb",
      "backendType": "vyos",
      "deployType": "direct",
      "description": "slb test"
    }
  ]
}
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
inventories List See inventories. 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
#inventories
Name Type Description Starting Version
uuid String The UUID of the SLB group. 4.0.0
name String The name of the SLB group. 4.0.0
backendType String 4.0.0
deployType String 4.0.0
slbOfferingUuid String 4.0.0
description String The detailed description of the SLB group. 4.0.0
createDate Timestamp The time when the SLB group was created. 4.0.0
lastOpDate Timestamp The time when the SLB group was last modified. 4.0.0
slbVms List See slbVms. 4.0.0
lbs List See lbs. 4.0.0
networks List See networks. 4.0.0
#slbVms
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 VM UUID. 4.0.0
name String The name of the VM instance. 4.0.0
description String The detailed description of the VM 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 instance offering UUID. 4.0.0
rootVolumeUuid String The root volume UUID. 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 VM instance was created. 4.0.0
lastOpDate Timestamp The time when the VM 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 added to the VM instance. 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
#lbs
Name Type Description Starting Version
slbGroupUuid String 4.0.0
name String The name of the load balancer. 4.0.0
uuid String The UUID of the load balancer. 4.0.0
description String The detailed description of the load balancer. 4.0.0
state String 4.0.0
type String 4.0.0
vipUuid String The virtual IP UUID. 4.0.0
createDate Timestamp The time when the oad balancer was created. 4.0.0
lastOpDate Timestamp The time when the load balancer was last modified. 4.0.0
listeners List See listeners 4.0.0
#listeners
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 aclRefs. 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
#aclRefs
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
#networks
Name Type Description Starting Version
slbGroupUuid String 4.0.0
l3NetworkUuid String The L3 network UUID. 4.0.0
l3NetworkCategory String 4.0.0
l3NetworkType String 4.0.0
type String 4.0.0
createDate Timestamp The time when the network was created. 4.0.0
lastOpDate Timestamp The time when the network was last modified. 4.0.0

SDK Sample

Java SDK
QuerySlbGroupAction action = new QuerySlbGroupAction();
action.conditions = asList("uuid=8751fa7f60f4394ea89b9197961113f2");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySlbGroupAction.Result res = action.call();
Python SDK
QuerySlbGroupAction action = QuerySlbGroupAction()
action.conditions = ["uuid=067ab1149fd733359870c11f10398cfd"]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySlbGroupAction.Result res = action.call()

CreateSlbOffering

API Request

URLs
POST zstack/v1/instance-offerings/slb
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "zoneUuid": "bdbae55ce73b3e2ab8a4ae3a6df0b287",
    "managementNetworkUuid": "7661f1f6d5a63d6eb3b9c3890ab3f9bb",
    "imageUuid": "2bae0841f4c63f128efcf66d095d73b0",
    "name": "SLB-Offering",
    "cpuNum": 2.0,
    "memorySize": 1024.0,
    "sortKey": 0.0,
    "type": "SLB"
  },
  "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":{"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()

QuerySlbOffering

API Request

URLs
GET zstack/v1/instance-offerings/slb
GET zstack/v1/instance-offerings/slb/{uuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/instance-offerings/slb
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/instance-offerings/slb/cab5a4776ee936938d2cdd08860ee50a

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QuerySlbOffering, and pressing the Tab key.

API Response

Sample Response
{
  "inventories": [
    {
      "managementNetworkUuid": "fdd51745e9ee3a4cb5bca03cf021c22f",
      "zoneUuid": "305d0c8b5c5a3edd81a641911126c332",
      "imageUuid": "b2f980076c3e3e6f8e9f3d4fd22bb7fb",
      "name": "SLB-Offering",
      "cpuNum": 2.0,
      "cpuSpeed": 1.0,
      "memorySize": 1024.0,
      "type": "SLB"
    }
  ]
}
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
inventories List See inventories. 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
#inventories
Name Type Description Starting Version
managementNetworkUuid String The management network UUID. 4.0.0
zoneUuid String The zone UUID. 4.0.0
imageUuid String The image UUID. 4.0.0
uuid String The record UUID. 4.0.0
name String The name of the SLB offering. 4.0.0
description String The detailed description of the SLB offering. 4.0.0
cpuNum Integer 4.0.0
cpuSpeed Integer 4.0.0
memorySize Long 4.0.0
type String 4.0.0
allocatorStrategy String 4.0.0
sortKey Integer 4.0.0
createDate Timestamp The time when the SLB offering was created. 4.0.0
lastOpDate Timestamp The time when the SLB offering was last modified. 4.0.0
state String 4.0.0

SDK Sample

Java SDK
QuerySlbOfferingAction action = new QuerySlbOfferingAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QuerySlbOfferingAction.Result res = action.call();
Python SDK
QuerySlbOfferingAction action = QuerySlbOfferingAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QuerySlbOfferingAction.Result res = action.call()

CreateSlbInstance

API Request

URLs
POST zstack/v1/load-balancers/slb/instances
Headers
Authorization: OAuth the-session-uuid
Body
{
  "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/instances
Request 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.
  • VYOS
4.0.0
hostUuid String body(contained in the params structure) Optional. The host UUID.
  • Direct
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()
API Reference | 4.8.38 | ZStack Cloud · ZCF | ZStack Resource Center