Zevenet Community Edition API v3.1
ZAPI (Zevenet Application Programming Interface) is the tool for system administrator to controler Zevenet load balancer conduct.
It is necessary active the zapi user from the web interface before use it, System/Users.
Once the zapi user has been created, it is possible send request to the URL, https://(zevenet_server):444/zapi/v3.1/zapi.cgi/(URI_path), where zevenet_server is the IP where HTTP service is listening.
URI_path
defines the object or action to act. His behavior and his parameters will be defined within each one doctumentation section.
The verbs used in this API will be GET, POST, PUT or DELETE. A PUT or POST request always need almost a parameter although this doesn’t need any required parameter.
Certificates
Zevenet supports cetificates in PEM format to use them with your HTTP farms with HTTPS listener. If you want to learn more about how to create pem certificates please visit the following article: GENERATE CERTIFICATES IN PEM FORMAT
List all Certificates
List all Certificates
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/certificates
GET /certificates
List all CSR and PEM certificates in the certificates store, those certificates can be used with HTTPS farms.
The response will be a JSON object with a key set to params. The value of this will be an array of certificate objects, each of which contain the key attributes below.
Response example:
{
"description" : "List all certificates",
"params" : [
{
"CN" : "Zen Load Balancer",
"creation" : "Jan 12 14:49:03 2011 GMT",
"expiration" : "Jan 9 14:49:03 2021 GMT",
"file" : "zencert.pem",
"issuer" : "Zen Load Balancer",
"type" : "Certificate"
}
]
}
Response parameters
Field | Type | Description |
---|---|---|
params | Object[ ] | List of certificate objects. |
Certificate Object
Field | Type | Description |
---|---|---|
CN | String | Domain common name. |
creation | String | Creation date. |
expiration | String | Expiration date. |
file | String | File name of the certificate, unique ID. |
issuer | String | Certified Authority signing the certificate. |
type | String | CSR or Certificate. |
Download Certificate
Download Certificate
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/certificates/example.pem
GET /certificates/<file>
Download a certificate installed in the certificates store, use the file name in the request to identify it.
The response will include the headers indicated below with information about the file. The body of the response will be the content of the file.
Response headers:
HTTP/1.1 200 OK
Date: Thu, 22 Dec 2016 09:27:47 GMT
Content-Disposition: attachment; filename="example.pem"
Content-Type: application/x-download; charset=ISO-8859-1
Content-Length: 2359
Delete a Certificate
Delete a Certificate
Request example:
curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/certificates/example.pem
DELETE /certificates/<file>
Delete a certificate by file name in the certificates store.
Response example:
{
"description" : "Delete certificate",
"message" : "The Certificate example.pem has been deleted.",
"success" : "true"
}
Create a CSR certificate
Create a CSR certificate
Request example:
curl -k -X POST -H "ZAPI_KEY: <ZAPI_KEY_STRING>" -H 'Content-Type: application/json'
-d '{"name":"NewCSR","fqdn":"host.domain.com","division":"IT","organization":"Example Corp.",
"locality":"Madrid","state":"Madrid","country":"ES","mail":"info@domain.com"}'
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/certificates
POST /certificates
Create a Certificate Signing Request (CSR file).
Request parameters
Field | Type | Description | Required |
---|---|---|---|
name | String | Certificate ID name. | true |
fqdn | String | The fully qualified domain name of your server. | true |
division | String | The division of your organization handling the certificate. | true |
organization | String | The legal name of your organization. | true |
locality | String | The city where your organization is located. | true |
state | String | The state/region where your organization is located. | true |
country | String | The two-letter ISO code for the country where your organization is location. | true |
String | An email address used to contact your organization. | true |
Response example:
{
"description" : "Create CSR",
"message" : "Certificate NewCSR created",
"success" : "true"
}
Upload a Certificate
Upload a Certificate
Request example:
curl -k -X POST -H "ZAPI_KEY: <ZAPI_KEY_STRING>" -H 'Content-Type: text/plain'
--tcp-nodelay --data-binary @/local_path/to/example.pem
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/certificates/example.pem
POST /certificates/<file>
Upload a PEM certificate for HTTP farms with HTTPS listener.
Requires the parameter --tcp-nodelay
, and --data-binary
to upload the file in binary mode.
Request URI parameters
Field | Type | Description | Required |
---|---|---|---|
file | String | Certificate file name to upload and save in the certificates store. | true |
Response example:
{
"description" : "Upload PEM certificate",
"message" : "Certificate uploaded",
"success" : "true"
}
List Ciphers
List Ciphers
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/ciphers
GET /ciphers
List the available ciphers that a HTTPS farm can use.
The response will be a JSON object with a key set to params. The value of this will be an array of certificate objects, each of which contain the key attributes below.
Response example:
{
"description" : "Get the ciphers available",
"params" : [
{
"ciphers" : "all",
"description" : "All"
},
{
"ciphers" : "highsecurity",
"description" : "High security"
},
{
"ciphers" : "customsecurity",
"description" : "Custom security"
}
]
}
Response parameters
Field | Type | Description |
---|---|---|
params | Object[ ] | List of certificate objects. |
Certificate Object
Field | Type | Description |
---|---|---|
ciphers | String | It is used as unique identifier. |
description | String | Friendly name. |
Farms
Zevenet is able to manage traffic in three different ways, each way is managed by a different module, Local service load balancer or LSLB module and Datalink Service Load Balancer or DSLB module.
All modules work with the Farm profile concept, a Farm profile is a group of parameters ready to do an especific action with the network traffic, it is important to understand what is able to do each farm profile in order to obtain the best results of Zevenet ADC.
- LSLB: This module is able to work with http and l4xnat profile farms. It works as a web reverse proxy or router
- DSLB: This module is able to work with datalink profile farm. It works as a gateway.
List all farms
List all farms
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms
GET /farms
List all available farms
The response will be a JSON object with a key set to params. The value of this will be an array of farm resume objects, each of which contains the key attributes below.
Farm Object
Field | Type | Description |
---|---|---|
farmname | String | Farm descriptive name. It is used as unique identificator. |
profile | String | Profile type, the profile available values are: http, https or l4xnat for LSLB module and datalink for DSLB module |
status | String | Farm status. The available status values are: down, the farm is not running; needed restart, the farm is up but it is pending of a restart action; critical, the farm is up and all backends are unreachable or maintenance; problem, the farm is up and there are some backend unreachable, but almost a backend is in up status; maintenance, the farm is up and there are backends in up status, but almost a backend is in maintenance mode; up, the farm is up and all the backends are working success. |
vip | String | Virtual IP where farm is receiving traffic |
vport | String | Virtual Port where farm is receiving traffic, port available values are: a port number for http[s] and l4xnat, a group of ports separated by “,” or a port range separated by “:” for l4xnat profiles, in l4xnat both separator values (“,” and “:”) can be used at the same field. |
Response example:
{
"description" : "List farms",
"params" : [
{
"farmname" : "httpFarm",
"profile" : "http",
"status" : "up",
"vip" : "192.168.101.146",
"vport" : "81"
}
]
}
Delete a Farm
Delete a Farm
Request example:
curl --tlsv1 -k -X DELETE -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms/FarmHTTP
DELETE /farms/<farmname>
Delete a farm through its farm name identfier.
Response example:
{
"description" : "Delete farm FarmHTTP",
"message" : "The Farm FarmHTTP has been deleted.",
"success" : "true"
}
Set an action in a Farm
Set an action in a Farm
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"action":"stop"}' https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms/FarmTCP/actions
PUT /farms/<farmname>/actions
Apply an action to a farm, see the Request parameters table for actions.
Request parameters
Field | Type | Description |
---|---|---|
action | String | Set the action desired. The actions are: stop, the farm will be stopped. start, the farm will be started and restart, the farm will be stopped and started automatically. |
Response example:
{
"description" : "Set a new action in FarmHTTP",
"params" : [
{
"action" : "stop"
}
]
}
Response parameters
If there are no issues in the configuration then zapi will return the requested action.
HTTP Farms
HTTP profile is an advanced layer 7 load balancing (or Application Delivery Controller) with proxy special properties. This profile offers some features like HTTPS layer 7 load balancing. This profile is adecuated for web services (web application servers included) and all application protocols based on HTTP and HTTPS protocols like WebDav, RDP over HTTP, ICA over HTTP, etc. In order to configure this farm profile, a virtual IP address and a virtual TCP port will be required.
Retrieve farm by name
Retrieve farm by name
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms/httpFarm
GET /farms/<farmname>
Show all configuration about a given farm.
Response example:
{
"description" : "List farm httpFarm",
"params" : {
"certlist" : [
{
"file" : "zencert.pem",
"id" : 1
}
],
"cipherc" : "ALL",
"ciphers" : "all",
"contimeout" : 20,
"disable_sslv2" : "true",
"disable_sslv3" : "false",
"disable_tlsv1" : "false",
"disable_tlsv1_1" : "true",
"disable_tlsv1_2" : "false",
"error414" : "Request URI is too long.",
"error500" : "An internal server error occurred. Please try again later.",
"error501" : "This method may not be used.",
"error503" : "The service is not available. Please try again later.",
"httpverb" : "MSRPCext",
"listener" : "https",
"reqtimeout" : 30,
"restimeout" : 45,
"resurrectime" : 10,
"rewritelocation" : "enabled",
"status" : "up",
"vip" : "192.168.100.211",
"vport" : 200
},
"services" : [
{
"backends" : [],
"fgenabled" : "false",
"fglog" : "false",
"fgscript" : "",
"fgtimecheck" : 5,
"httpsb" : "false",
"id" : "service3",
"leastresp" : "false",
"persistence" : "",
"redirect" : "",
"redirecttype" : "",
"sessionid" : "",
"ttl" : 0,
"urlp" : "",
"vhost" : ""
},
{
"backends" : [
{
"id" : 0,
"ip" : "192.168.0.168",
"port" : 80,
"status" : "up",
"timeout" : null,
"weight" : null
}
],
"fgenabled" : "false",
"fglog" : "false",
"fgscript" : "tcp_check",
"fgtimecheck" : 5,
"httpsb" : "false",
"id" : "srv",
"leastresp" : "false",
"persistence" : "",
"redirect" : "",
"redirecttype" : "",
"sessionid" : "",
"ttl" : 0,
"urlp" : "",
"vhost" : ""
},
]
}
Response parameters
The response will be a JSON object with the format below.
Farm Object:
Field | Type | Description |
---|---|---|
params | Object | Parameters of farm configuration. |
services | Object[] | Array with all services created in this farm and its configuration. |
Parameters object for HTTP farms:
Field | Type | Description |
---|---|---|
certlist | Object[] | Only in https profile. Certificate actived in the farm, in pem format, it is allowed to add only one pem certificate to the same farm. listener with https value is required. Any pem certificate in the certificates store can be used here. |
cipherc | String | Only in https listener. This is the allowed customized list of ciphers that will be accepted by the SSL connection, which it’s a string in the same format as in OpenSSL ciphers. This atribute is used only when ciphers field has the value sutomsecurity. |
ciphers | String | Only in listener with https value. Used to build a list of ciphers accepted by SSL connections in order to harden the SSL connection. The options are: all, all the ciphers will be accepted; highsecurity, only ciphers for high security will be accepted; or customsecurity, only ciphers loaded in cipherc field will be accepted. |
contimeout | Number | How long the farm is going to wait for a TCP connection to the backend in seconds. |
disable_sslv2 | String | Only in https listener. If this field has the value true the connections using SSL security protocol with version 2 is not allowed; or false if the protocol SSLv2 is allowed. |
disable_sslv3 | String | Only in https listener. If this field has the value true the connections using SSL security protocol with version 3 is not allowed; or false if the protocol SSLv3 is allowed. |
disable_tlsv1 | String | Only in https listener. If this field has the value true the connections using TLS security protocol with version 1 is not allowed; or false if the protocol TLSv1 is allowed. |
disable_tlsv1_1 | String | Only in https listener. If this field has the value true the connections using TLS security protocol with version 1.1 is not allowed; or false if the protocol TLSv1.1 is allowed. |
disable_tlsv1_2 | String | Only in https listener. If this field has the value true the connections using TLS security protocol with version 1.2 is not allowed; or false if the protocol TLSv1.2 is allowed. |
error414 | String | Personalized message for responsing with the 414 HTTP error code. |
error500 | String | Personalized message for responsing with the 500 HTTP error code. |
error501 | String | Personalized message for responsing with the 501 HTTP error code. |
error503 | String | Personalized message for responsing with the 503 HTTP error code. |
httpverb | String | This field indicates the operations that will be permitted to the HTTP client requests. available values are: standardHTTP,naccepted http requests GET, POST, HEAD. extendedHTTP, accepted previous http requests plus PUT,DELETE. standardWebDAV, accepted previous http requests plus LOCK, UNLOCK, PROPFIND, PROPPATCH, SEARCH, MKCOL, MOVE, COPY, OPTIONS, TRACE, MKACTIVITY, CHECKOUT, MERGE, REPORT, MSextWebDAV accepted previous http requests plus SUBSCRIBE, UNSUBSCRIBE, NOTIFY, BPROPFIND, BPROPPATCH, POLL, BMOVE, BCOPY, BDELETE, CONNECT, or MSRPCext, accepted previous http requests plus RPC_IN_DATA, RPC_OUT_DATA. Note that those values are case-sensitve. |
listener | String | A listener defines how the farm is going to play with the requests from the clients. The options are: http for not secured protocol or https for secured protocol. |
reqtimeout | Number | How long the farm is going to wait for a client request in seconds. |
restimeout | Number | How long the farm is going to wait for a response from the backends in seconds. |
resurrectime | Number | The period to get out a fallen real server, after this period the load balancer checks if the real server is alive, in seconds. |
rewritelocation | String | If it is enabled, the farm is forced to modify the Location: and Content-location: headers in responses to clients with the virtual host. The options are: enabled, actived disabled, inactived or enabled-backends only the backend address is compared. |
status | String | Farm status. The available status values are: down, the farm is not running; needed restart, the farm is up but it is pending of a restart action; critical, the farm is up and all backends are unreachable or maintenance; problem, the farm is up and there are some backend unreachable, but almost a backend is in up status; maintenance, the farm is up and there are backends in up status, but almost a backend is in maintenance mode; up, the farm is up and all the backends are working success. |
vip | String | IP of the farm, where the virtual service is listening. |
vport | Number | Port of the farm, where the virtual service is listening. |
Certlist Object:
Field | Type | Description |
---|---|---|
file | String | The certificate name, references to the certificate in the certificates store. |
id | Number | Certificate ID. |
Services object for HTTP farms:
Field | Type | Description |
---|---|---|
backends | Object[] | Backends defined in the service. |
fgenabled | String | Enable the use of farm guardian. true farm guardian is enabled and checking backends status, false farm guardian is disabled and not checking backends status. In HTTP profiles a check_tcp is executed by default even if farm guardian is disabled. |
fglog | String | Enable the use of logs in farm guardian. true enabled, false, disabled. fgenabled is required. |
fgscript | String | The command that farm guardian will use for checking backends health. true enabled, false, disabled. fgenabled is required. |
fgtimecheck | Number | farm guardian will check each ‘timetocheck’ seconds the backend health status. fgenabled is required. |
httpsb | String | This parameter indicates to the farm that the backends servers defined in the current service are using the HTTPS language and then the data will be encrypted before to be sent. true, the profile sends the traffic in HTTPS protocol to the backends, false, the profile sends the traffic in HTTP protocol to the backends. |
id | String | Service’s name, it can’t be modified once the service is created. |
leastresp | String | It enables the least responde balancing method. true frecuently the profile checks which backend is taking less time to respond in order to send more connections to this one, false profile doesn’t check which backend is taking less time to respond. |
persistence | String | This parameter defines how the HTTP service is going to manage the client session. The options are: “” empty string, no action is taken, IP the persistence session is done in base of client IP, BASIC the persistence session is done in base of BASIC headers, URL the persistence session is done in base of a field in the URI, PARM the persistence session is done in base of a value at the end of the URI, COOKIE the persistence session is done in base of a cookie name, this cookie has to be created by the backends, and HEADER, the persistence session is done in base of a Header name. |
redirect | String | It behaves as a special backend, as the client request is answered by a redirect to a new URL automatically. If redirect is configured then the request will not be forwarded to the backend, a Redirect will be responded to the client instead. |
redirecttype | String | How the redirection will be done, two options: default, the url is taken as an absolute host and path to redirect to, append, the original request path or URI will be appended to the host and path you specified with default option. If redirect field is not configurated, this field will be an empty string. |
sessionid | String | It is avaliable if persistence field is URL, COOKIE or HEADER, the parameter value will be searched by the farm in the http header and will manage the client session. |
ttl | Number | Only with persistence. This value indicates the max time of life for an inactive client session (max session age) in seconds. |
urlp | String | Allows to determine a web service regarding the URL the client is requesting through a specific URL pattern which will be syntactically checked. PCRE regular expression is supported. |
vhost | String | It specifies the condition determined by the domain name through the same virtual IP and port defined by a HTTP farm. PCRE regular expression is supported. |
Backend object for HTTP farms:
Field | Type | Description |
---|---|---|
id | Number | Backend identifier inside the given service. |
ip | String | Backend’s IP where the real service is running. |
port | Number | Backend’s port where the real service is running. |
status | String | Backend status. The possible values are: up, the farm is running and the backend is ready to receive connections; down, the farm is running and the service has detected that the backend is not working; maintenance, backend is marked as not ready for receiving connections by the administrator, this option is useful for backend’s maintance tasks; undefined, the backend status has been not checked. |
timeout | Number | It’s the backend timeout to respond a certain request, in seconds. If null system will use global parameter Backends timeout. |
weight | Number | It’s the weight value for the current real server, backend with higher weight value will receive more connections. Default value null, not special weight used for this backend. |
Create a new Farm
Create a new Farm
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"farmname":"newHTTPfarm", "profile":"http", "vip":"192.168.100.23",
"vport":80}' https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms
POST /farms
Create a new HTTP farm.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
farmname | String | Farm descriptive name. It is used as unique identifier. | true |
profile | String | The profile of the created Farm. For http farms is http. | true |
vip | String | IP of the farm, where the virtual service is going to run. The indicated IP must be configured in the system and UP | true |
vport | Number | Port of the farm, where the virtual service is going to listen. Same virtual port and virtual IP must not be in use by another farm. | true |
Response example:
{
"description" : "Creating farm 'newHTTPfarm'",
"params" : {
"farmname" : "newHTTPfarm",
"profile" : "http",
"vip" : "192.168.100.23",
"vport" : 80
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Modify a Farm
Modify a Farm
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"contimeout":22,"newfarmname":"FarmHTTP2","vip":"178.62.126.152","vport":88,"ignore_100_continue":"true",
"restimeout":47,"resurrectime":12,"reqtimeout":32,"rewritelocation":"enabled","httpverb":"standardHTTP",
"error414":"Message error 414","error500":"Message error 500","error501":"Message error 501",
"error503":"Message error 503","listener":"https","ciphers":"customsecurity","disable_sslv2":"true",
"disable_sslv3":"false","disable_tlsv1":"false","disable_tlsv1_1":"true","disable_tlsv1_2":"false",
"cipherc":"TLSv1+SSLv3+HIGH:-MEDIUM:-LOW*:-ADH*"}' https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/FarmHTTP
PUT /farms/<farmname>
Modify global parameters for a given HTTP farm.
Request parameters
Field | Type | Description |
---|---|---|
contimeout | Number | How long the farm is going to wait for a connection to the backend in seconds. |
restimeout | Number | How long the farm is going to wait for a response from the backends in seconds. |
resurrectime | Number | This value in seconds is the period to get out a blacklisted backend and checks if is alive. |
reqtimeout | Number | How long the farm is going to wait for a client request in seconds. |
disable_sslv2 | String | Only in https listener. If this field has the value true the connections using SSL security protocol with version 2 is not allowed; or false if the protocol SSLv2 is allowed. |
disable_sslv3 | String | Only in https listener. If this field has the value true the connections using SSL security protocol with version 3 is not allowed; or false if the protocol SSLv3 is allowed. |
disable_tlsv1 | String | Only in https listener. If this field has the value true the connections using TLS security protocol with version 1 is not allowed; or false if the protocol TLSv1 is allowed. |
disable_tlsv1_1 | String | Only in https listener. If this field has the value true the connections using TLS security protocol with version 1.1 is not allowed; or false if the protocol TLSv1.1 is allowed. |
disable_tlsv1_2 | String | Only in https listener. If this field has the value true the connections using TLS security protocol with version 1.2 is not allowed; or false if the |
rewritelocation | String | If it is enabled, the farm is forced to modify the Location: and Content-location: headers in responses to clients with the virtual host. The options are: enabled, actived disabled, inactived or enabled-backends only the backend address is compared. |
httpverb | String | This field indicates the operations that will be permitted to the HTTP client requests. available values are: standardHTTP,naccepted http requests GET, POST, HEAD. extendedHTTP, accepted previous http requests plus PUT,DELETE. standardWebDAV, accepted previous http requests plus LOCK, UNLOCK, PROPFIND, PROPPATCH, SEARCH, MKCOL, MOVE, COPY, OPTIONS, TRACE, MKACTIVITY, CHECKOUT, MERGE, REPORT, MSextWebDAV accepted previous http requests plus SUBSCRIBE, UNSUBSCRIBE, NOTIFY, BPROPFIND, BPROPPATCH, POLL, BMOVE, BCOPY, BDELETE, CONNECT, or MSRPCext, accepted previous http requests plus RPC_IN_DATA, RPC_OUT_DATA. Note that those values are case-sensitve. |
error414 | String | Personalized message error 414. |
error500 | String | Personalized message error 500. |
error501 | String | Personalized message error 501. |
error503 | String | Personalized message error 503. |
listener | String | A listener defines how the farm is going to play with the requests from the clients. The options are: http for not secured protocol or https for secured protocol. |
ciphers | String | Only in listener with https value. Used to build a list of ciphers accepted by SSL connections in order to harden the SSL connection. The options are: all, all the ciphers will be accepted; highsecurity, only ciphers for high security will be accepted; or customsecurity, only ciphers loaded in cipherc field will be accepted. |
cipherc | String | Only in https listener. This is the allowed customized list of ciphers that will be accepted by the SSL connection, which it’s a string in the same format as in OpenSSL ciphers. This atribute is used only when ciphers field has the value sutomsecurity. |
newfarmname | String | The new Farm’s name. Farm must be stopped. |
vport | Number | Port of the farm, where the virtual service is listening. |
vip | String | IP of the farm, where the virtual service is listening, this IP must be configured and up in the system. |
Response example:
{
"description" : "Modify farm FarmHTTP",
"params" : {
"cipherc" : "TLSv1+SSLv3+HIGH:-MEDIUM:-LOW*:-ADH*",
"ciphers" : "customsecurity",
"contimeout" : 22,
"disable_sslv2" : "true",
"disable_sslv3" : "false",
"disable_tlsv1" : "false",
"disable_tlsv1_1" : "true",
"disable_tlsv1_2" : "false",
"error414" : "Message error 414",
"error500" : "Message error 500",
"error501" : "Message error 501",
"error503" : "Message error 503",
"httpverb" : "standardHTTP",
"listener" : "https",
"newfarmname" : "FarmHTTP",
"reqtimeout" : 32,
"restimeout" : 47,
"resurrectime" : 12,
"rewritelocation" : "enabled",
"vip" : "178.62.126.152",
"vport" : 88
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Add a Certificate
Add a Certificate
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"file":"example.pem"}' https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms/httpFarm/certificates
POST /farms/<farmname>/certificates
Change the PEM Certificate of an HTTP farm with an HTTPS listener. The used certificate has to be already uploaded in the system, see Certificates > List all Certificates for the available certificates list.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
file | String | certificate file name, previously the certificate has to be uploaded in the system. | true |
Response example:
{
"description" : "Add certificate",
"message" : "The certificate example.pem has been added to the farm httpFarm, you need restart the farm to apply",
"success" : "true",
"status": "needed restart"
}
HTTP - Services
The services within a HTTP profile farm provides a content switching method to deliver several web services with different properties, backends or even persistence methods, through some deterministic conditions used by the farm core in order to match the correct service for every client request. This service definition will be used by the farm in order to determine the backends servers that could deliver the response to the client.
Inside service object there are two kinds of values: service related and farmguardian related.
Farmguardian is used for advanced monitoring state of backends and totally personalized for your own scripts for the current service. When a problem is detected by farmguardian automatically disables the real server and will be marked as blacklisted.
Retrieve service by ID
Retrieve service by ID
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms/cookiefarm/services/serv
GET /farms/<farmname>/services/<id>
Show all configuration about a given service.
Response example:
{
"description" : "Get services of a farm",
"services" : {
"backends" : [
{
"id" : 0,
"ip" : "192.168.100.254",
"port" : 80,
"status" : "up",
"timeout" : 20,
"weight" : null
},
{
"id" : 0,
"ip" : "192.168.100.254",
"port" : 80,
"status" : "up",
"timeout" : null,
"weight" : null
}
],
"fgenabled" : "false",
"fglog" : "false",
"fgscript" : "check_tcp -H HOST -p PORT",
"fgtimecheck" : 5,
"httpsb" : "false",
"id" : "serv",
"leastresp" : "false",
"persistence" : "COOKIE",
"redirect" : "",
"redirecttype" : "",
"sessionid" : "JSESSIONID",
"ttl" : 18,
"urlp" : "(?i)^/music$",
"vhost" : ""
}
}
Response parameters
The response will be a JSON object with the format below.
Services object for HTTP farms:
Field | Type | Description |
---|---|---|
backends | Object[] | Backends defined in the service. |
fgenabled | String | Enable the use of farm guardian. true farm guardian is enabled and checking backends status, false farm guardian is disabled and not checking backends status. In HTTP profiles a check_tcp is executed by default even if farm guardian is disabled. |
fglog | String | Enable the use of logs in farm guardian. true enabled, false, disabled. fgenabled is required. |
fgscript | String | The command that farm guardian will use for checking backends health. true enabled, false, disabled. fgenabled is required. |
fgtimecheck | Number | farm guardian will check each 'timetocheck’ seconds the backend health status. fgenabled is required. |
httpsb | String | This parameter indicates to the farm that the backends servers defined in the current service are using the HTTPS language and then the data will be encrypted before to be sent. true, the profile sends the traffic in HTTPS protocol to the backends, false, the profile sends the traffic in HTTP protocol to the backends. |
id | String | Service’s name, it can’t be modified once the service is created. |
leastresp | String | It enables the least responde balancing method. true frecuently the profile checks which backend is taking less time to respond in order to send more connections to this one, false profile doesn’t check which backend is taking less time to respond. |
persistence | String | This parameter defines how the HTTP service is going to manage the client session. The options are: “” empty string, no action is taken, IP the persistence session is done in base of client IP, BASIC the persistence session is done in base of BASIC headers, URL the persistence session is done in base of a field in the URI, PARM the persistence session is done in base of a value at the end of the URI, COOKIE the persistence session is done in base of a cookie name, this cookie has to be created by the backends, and HEADER, the persistence session is done in base of a Header name. |
redirect | String | It behaves as a special backend, as the client request is answered by a redirect to a new URL automatically. If redirect is configured then the request will not be forwarded to the backend, a Redirect will be responded to the client instead. |
redirecttype | String | How the redirection will be done, two options: default, the url is taken as an absolute host and path to redirect to, append, the original request path or URI will be appended to the host and path you specified with default option. If redirect field is not configurated, this field will be an empty string. |
sessionid | String | It is avaliable if persistence field is URL, COOKIE or HEADER, the parameter value will be searched by the farm in the http header and will manage the client session. |
ttl | Number | Only with persistence. This value indicates the max time of life for an inactive client session (max session age) in seconds. |
urlp | String | Allows to determine a web service regarding the URL the client is requesting through a specific URL pattern which will be syntactically checked. PCRE regular expression is supported. |
vhost | String | It specifies the condition determined by the domain name through the same virtual IP and port defined by a HTTP farm. PCRE regular expression is supported. |
Backend object for HTTP farms:
Field | Type | Description |
---|---|---|
id | Number | Backend identifier inside the given service. |
ip | String | Backend’s IP where the real service is running. |
port | Number | Backend’s port where the real service is running. |
status | String | Backend status. The possible values are: up, the farm is running and the backend is ready to receive connections; down, the farm is running and the service has detected that the backend is not working; maintenance, backend is marked as not ready for receiving connections by the administrator, this option is useful for backend’s maintance tasks; undefined, the backend status has been not checked. |
timeout | Number | It’s the backend timeout to respond a certain request, in seconds. If null system will use global parameter Backends timeout. |
weight | Number | It’s the weight value for the current real server, backend with higher weight value will receive more connections. Default value null, not special weight used for this backend. |
Create a new Service
Create a new Service
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"id":"newserv"}' https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/FarmHTTP/services
POST /farms/<farmname>/services
Create a service in a given HTTP profile Farm. The farm needs a restart action to apply this change.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
id | String | Service name which is used as unique identifier. Only alphanumeric values are allowed. | true |
Response example:
{
"description" : "New service newserv",
"params" : {
"id" : "newserv"
},
"status" : "needed restart"
}
Modify a Service
Modify a Service
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"vhost":"www.mywebserver.com","urlp":"^/myapp1$","persistence":"URL",
"redirect":"http://zenloadbalancer.com","ttl":125,"sessionid":"sid","leastresp":"true",
"httpsb":"true"}' https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/FarmHTTP/services/sev2
PUT /farms/<farmname>/services/<id>
Modify the parameters of a service in a HTTP profile. id is the service unique identifier which will be modified.
Request parameters
Field | Type | Description |
---|---|---|
vhost | String | Specifies the condition determined by the domain name through the same virtual IP and port defined by a HTTP profile farm. PCRE regular expression is supported. |
urlp | String | Allows to determine a web service regarding the URL the client is requesting through a specific URL pattern which will be syntactically checked. PCRE regular expression is supported. |
redirect | String | It works as a special backend, the client request is answered by a redirect to a new URL automatically. |
redirecttype | String | How the redirect will be done, two options: default, the url is taken as an absolute host and path to redirect to, append, the original request path or URI will be appended to the host and path you specified in redirect field. This behaviour will apply only if redirect is not an empty value. |
persistence | String | This parameter defines how the HTTP service is going to manage the client session. The options are: “” empty string, no action is taken, IP the persistence session is done in base of client IP, BASIC the persistence session is done in base of BASIC headers, URL the persistence session is done in base of a field in the URI, PARM the persistence session is done in base of a value separated by “;” at the end of the URI, COOKIE the persistence session is done in base of a cookie name, this cookie has to be created by the backends, and HEADER, the persistence session is done in base of a Header name. |
ttl | Number | Only with persistence. The max time of life for an inactive client session (max session age) in seconds. |
sessionid | String | It is avaliable if persistence field is URL, COOKIE or HEADER, the parameter value will be searched by the profile in the http header and will manage the client session. |
leastresp | String | It enables the least responde balancing method. true, frecuently the profile checks which backend is taking less time to respond in order to send more connections to thisone, false, profile doesn’t check which backend is taking less time to respond. |
httpsb | String | It indicates to the farm that the backends servers defined in the current service are using the HTTPS language and then the data will be encrypted before to be sent. true, the profile sends the traffic in HTTPS protocol to the backends, false, the profile sends the traffic in HTTP protocol to the backends. |
Response example:
{
"description" : "Modify service newsrv in farm newHTTPfarm",
"info" : "There're changes that need to be applied, stop and start farm to apply them!",
"params" : {
"backends" : [],
"fgenabled" : "false",
"fglog" : "false",
"fgscript" : "",
"fgtimecheck" : 5,
"httpsb" : "true",
"id" : "newsrv",
"leastresp" : "true",
"persistence" : "",
"redirect" : "http://zenloadbalancer.com",
"redirecttype" : "default",
"sessionid" : "sid",
"ttl" : 125,
"urlp" : "^/myapp1$",
"vhost" : "www.mywebserver.com"
},
"status" : "needed restart"
}
Response Parameters
The response will be a json with requested parameters updated and the status field with needed restart value. Restart action need to be taken in order to apply the changes.
Modify farm guardian
Modify farm guardian
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"fgtimecheck":5,"fgscript":"check_tcp","fgenabled":"true",
"fglog":"true","service":"service1"}' https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms/FarmHTTP/fg
Farmguardian is used for advanced monitoring state of backends and totally personalized for your own scripts for the current service. When a problem is detected by farmguardian automatically disables the real server and will be marked as blacklisted.
PUT /farms/<farmname>/fg
Modify the parameters of farm guardian in the given HTTP profile.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
fgtimecheck | Number | The farm guardian will check the backends health status each 'timetocheck’ seconds. | |
fgscript | String | The command that farm guardian will run for checking backends health status | |
fgenabled | String | It enables farm guardian in the indicated service. true farm guardian is going to be used for checking backends status, false farm guardian is going to be disabled | |
fglog | String | Enable the use of logs in farm guardian. true farm guardian is going to log any action, false farm guardian is not going to log any action, it is recommended to enable fglog only for troubleshooting. | |
service | String | Service name used as unique identifier. | true |
Response example:
{
"description" : "Modify farm FarmHTTP",
"params" : {
"fgenabled" : "true",
"fglog" : "true",
"fgscript" : "checktcp",
"fgtimecheck" : 5,
"service" : "service1"
}
}
Delete a Service
Delete a Service
Request example:
curl -k -X DELETE -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/FarmHTTP/services/service1
DELETE /farms/<farmname>/services/<id>
Delete a given service of a http profile. id is the service unique identifier which will be deleted.
Response example:
{
"description" : "Delete service service1 in farm FarmHTTP",
"message" : "The service service1 in farm FarmHTTP has been deleted.",
"success" : "true",
"status": "needed restart"
}
HTTP - Services - Backends
List the backends
List the backends
Request example:
curl -k -X GET -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/httpfarm/services/service1/backends
GET /farms/<farmname>/services/<id>/backends
Get the list of backends in a service. id is the service unique identifier.
Response example:
{
"description" : "List service backends",
"params" : [
{
"id" : 0,
"ip" : "192.168.0.10",
"port" : 88,
"status" : "up",
"timeout" : 12,
"weight" : 1
},
{
"id" : 1,
"ip" : "192.168.102.245",
"port" : 80,
"status" : "up",
"timeout" : 22,
"weight" : 2
}
]
}
Response Parameters
This call returns a backend object array with the bellow parameters.
Field | Type | Description |
---|---|---|
id | Number | Unique identifier for the backend in the service. This identifier is generated by the system. |
ip | String | Backend’s IP where the real service is listening. |
port | Number | Backend’s port where the real service is listening. |
timeout | Number | It’s the backend timeout to respond a certain request, in seconds. |
weight | Number | It’s the weight value for the current backend. |
status | String | Backend status. The possible values are: up, the farm is running and the backend is ready to receive connections; down, the farm is running and the service has detected that the backend is not working; maintenance, backend is marked as not ready for receiving connections by the administrator, this option is useful for backend’s maintance tasks; undefined, the backend status has been not checked. |
Create a new Backend
Create a new Backend
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.102.244","port":80, "weight":2,"timeout":2}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/httpfarm/services/newsrv/backends
POST /farms/<farmname>/services/<id>/backends
Create a new Backend in a given HTTP profile. id is the service unique identifier.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
ip | String | Backend’s IP where the real service is listening. | true |
port | Number | Backend’s port where the real service is listening. | true |
timeout | Number | It’s the backend timeout to respond a certain request. | |
weight | Number | It’s the weight value for the current backend. |
Response example:
{
"description" : "New service backend",
"message" : "Added backend to service succesfully",
"params" : {
"id" : 0,
"ip" : "192.168.102.244",
"port" : 80,
"timeout" : 2,
"weight" : 2
},
"status" : "needed restart"
}
Response Parameters
The response will be a json with requested parameters updated and the status field with needed restart value if the farm must be restarted. Restart action need to be taken in order to apply the changes.
Modify a Backend
Modify a Backend
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.0.10","port":88,"timeout":12,"service":"sev2", "weight":1}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/FarmHTTP/service/service1/backends/1
PUT /farms/<farmname>/service/<id>/backends/<id>
Modify the parameters of a backend in a service of a HTTP profile.
First id is the service unique identifier, next id is the backend unique identifier.
Request parameters
Field | Type | Description |
---|---|---|
ip | String | Backend’s IP where the real service is listening. |
port | Number | Backend’s port where the real service is listening. |
timeout | Number | It’s the backend timeout to respond a certain request, in seconds. |
weight | Number | It’s the weight value for the current backend. |
Response example:
{
"description" : "Modify service backend",
"info" : "There're changes that need to be applied, stop and start farm to apply them!",
"message" : "Backend modified",
"params" : {
"ip" : "192.168.0.10",
"port" : 88,
"timeout" : 12,
"weight" : 1
},
"status" : "needed restart"
}
Response Parameters
The response will be a json with requested parameters updated and the status field with needed restart value if the farm must be restarted. Restart action need to be taken in order to apply the changes.
Backend in maintenance
Backend in maintenance
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"action":"maintenance","mode":"cut"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/httpfarm/services/newsrv/backends/0/maintenance
PUT /farms/<farmname>/services/<id>/backends/<id>/maintenance
Set a given action in a backend of a HTTP farm, available actions are described below.
First id is the service unique identifier, next id is the backend unique identifier.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
action | String | Set the action desired. The actions are: up the backend is ready to receive client requests, maintenance backend is not ready to receive client requests, this action is useful for stopping the backend server without affect to the clients. | true |
mode | String | Choose a maintenance mode. The available options are: drain, the backend doesn’t accept new connections, but it will continue to handle the current connections; or cut, the current connections will be closed. | If this field is not specified, the default mode will be drain. |
Response example:
{
"description" : "Set service backend status",
"params" : {
"action" : "maintenance",
"mode" : "cut"
}
}
Delete a backend
Delete a backend
Request example:
curl -k -X DELETE -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/newfarmHTTP/services/service1/backends/4
DELETE /farms/<farmname>/services/<id>/backends/<id>
Delete a given backend in a service of a HTTP profile.
First id is the service unique identifier, next id is the backend unique identifier.
Response example:
{
"description" : "Delete service backend",
"message" : "Backend removed",
"success" : "true"
}
L4xNAT Farms
The L4xNAT profile farm allows to create a L4 farm with a very high performance and much more concurrent connections than load balancer cores in layer 7 like HTTP farm profiles. That layer 4 performance improvement counteracts the advanced content handling that the layer 7 profiles could manage.
Additionally, L4xNAT farms could bind a range of ports, not only one virtual port as is used with other layer 7 profiles. In order to be able to select a range of virtual ports or a specific virtual port in L4xNAT farms, it’s mandatory to select a protocol type. In other case, the farm will be listening on all ports from the virtual IP ( indicated with a character ‘’ ). Once a TCP or UDP protocol is selected, it will be available to specify a port, several ports between ‘,’ , ports range between ‘:’ or all ports with ‘’. A combination of all of them will be valid as well.
Retrieve farm by name
Retrieve farm by name
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms/l4farm
GET /farms/<farmname>
Show all configuration about a given farm.
Response BODY:
{
"backends" : [
{
"id" : 0,
"ip" : "192.168.55.40",
"max_conns" : 0,
"port" : "88",
"priority" : 2,
"status" : "undefined",
"weight" : 1
},
{
"id" : 1,
"ip" : "192.168.55.41",
"max_conns" : 0,
"port" : "88",
"priority" : 3,
"status" : "undefined",
"weight" : 2
}
],
"description" : "List farm l4farm",
"params" : {
"algorithm" : "weight",
"fgenabled" : "false",
"fglog" : "false",
"fgscript" : "",
"fgtimecheck" : 5,
"listener" : "l4xnat",
"nattype" : "nat",
"persistence" : "",
"protocol" : "tcp",
"status" : "down",
"ttl" : 120,
"vip" : "192.168.100.241",
"vport" : "88"
}
}
Response parameters
The response will be a JSON object with the format below.
Farm Object:
Field | Type | Description |
---|---|---|
params | Object | Parameters of farm configuration. |
backends | Object[] | All real servers created in this farm and its configuration. |
Parameters object for L4xNAT farms:
Field | Type | Description |
---|---|---|
algorithm | String | Type of load balancing algorithm used in the Farm. The options are: leastconn connection always to the least connection server, weight connection linear dispatching by weight, prio connections always to the most prio available. |
listener | String | A listener defines how the farm is going to play with the requests from the clients. informational field, it can’t be modified. |
nattype | String | How the load balancer layer 4 core is going to operate. The options are: nat also called sNAT mode, the backend responds to the load balancer in order to send the response to the client, dnat the backend will respond directly to the client, load balancer has to be configured as gateway in the backend server. |
persistence | String | The same ip address will be connected to the same server. The options are: “” empty value, persistence is disabled, ip persistence is enabled through, origin IP is used like unique ID in session. |
protocol | String | Protocol to be balanced at layer 4. The options are: all the profile will load balance any L4 protocol, tcp the load balancer only will balance TCP L4 protocol, udp the load balancer only will balance UDP L4 protocol, sip the load balancer only will balance SIP or VoIP L7 protocol, ftp the load balancer only will balance FTP L7 protocol, tftp the load balancer only will balance TFTP L7 protocol. |
status | String | Farm status. The available status values are: down, the farm is not running; needed restart, the farm is up but it is pending of a restart action; critical, the farm is up and all backends are unreachable or maintenance; problem, the farm is up and there are some backend unreachable, but almost a backend is in up status; maintenance, the farm is up and there are backends in up status, but almost a backend is in maintenance mode; up, the farm is up and all the backends are working success. |
ttl | Number | This field value indicates the number of seconds that the persistence between the client source and the backend is being assigned, in seconds. Persistence must be configured. |
vip | String | IP of the farm, where the virtual service is listening. |
vport | String | Port of the farm, where the virtual service is listening. An unique port can be especified, a range port can be especified with separator : and several ports can be especified with separator ,. |
fgenabled | String | Enables the use of farm guardian. true farm guardian is enabled, false farm guardian is disabled. |
fglog | String | Enables the use of logs in farm guardian. fgenabled must be enabled. |
fgscript | String | The command that farm guardian will check. Those available commands are in libexec path. fgenabled must be enabled. |
fgtimecheck | Number | The farm guardian will check each ‘timetocheck’ seconds. fgenabled must be enabled. |
Backend object for L4xNAT farms:
Field | Type | Description |
---|---|---|
id | Number | ID to identificate the backend in the farm. |
ip | String | Backend’s IP where the real service is listening. |
max_conns | Number | It’s the maximum number of concurrent connection for the backend. If this field has the value 0, the backend doesn’t have configurated any connection limit. |
port | Number | Backend’s port where the real service is listening. Empty value is accepted and it will use the same configuration than virtual port(s). |
status | String | Backend status. The possible values are: up, the farm is running and the backend is ready to receive connections; down, the farm is running and the service has detected that the backend is not working; maintenance, backend is marked as not ready for receiving connections by the administrator, this option is useful for backend’s maintance tasks; undefined, the backend status has been not checked. |
priority | Number | It’s the priority value for the current real server. Connections always to the most prio available where 1 is the most priority. |
weight | Number | It’s the weight value for the current real server. Backends with more weight will receive more connections. |
Create a new Farm
Create a new Farm
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"profile":"l4xnat", "vip":"192.168.100.241", "vport":"88","farmname":"newl4farm"}'
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms
POST /farms
Create a new L4xNAT farm.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
farmname | String | Farm name, unique identifier. | true |
profile | String | The profile of the created Farm. For L4xNAT farms is l4xnat, information message, this value can’t be changed | true |
vip | String | IP of the farm, where the virtual service is listening. | true |
vport | String | Port of the farm, where the virtual service is listening. L4xNAT farms allow multiport separated by , or range port separated by :. | true |
Response example:
{
"description" : "Creating farm 'newl4farm'",
"params" : {
"farmname" : "newl4farm",
"interface" : "eth0",
"profile" : "l4xnat",
"vip" : "192.168.100.241",
"vport" : "88"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Modify a Farm
Modify a Farm
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"algorithm":"weight","persistence":"","newfarmname":"l4farm", "protocol":"tcp",
"nattype":"nat","ttl":125,"vip":"178.62.126.152","vport":"81"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/newfarml4
PUT /farms/<farmname>
Modify the configuration of a L4xNAT farm.
Request parameters
Field | Type | Description |
---|---|---|
newfarmname | String | The new Farm’s name. The farm must be stopped it. |
algorithm | String | Type of load balancing algorithm used in the Farm. The options are: leastconn connection always to the least connection server, weight connection linear dispatching by weight, prio connections always to the most prio available. |
nattype | String | How the load balancer layer 4 core is going to operate. The options are: nat also called sNAT mode, the backend responds to the load balancer in order to send the response to the client, dnat the backend will respond directly to the client, load balancer has to be configured as gateway in the backend server. |
persistence | String | The same ip address will be connected to the same server. The options are: “” empty value, persistence is disabled, ip persistence is enabled through, origin IP is used like unique ID in session. |
protocol | String | Protocol to be balanced at layer 4. The options are: all the profile will load balance any L4 protocol, tcp the load balancer only will balance TCP L4 protocol, udp the load balancer only will balance UDP L4 protocol, sip the load balancer only will balance SIP or VoIP L7 protocol, ftp the load balancer only will balance FTP L7 protocol, tftp the load balancer only will balance TFTP L7 protocol. |
ttl | Number | This field value indicates the number of seconds that the persistence between the client source and the backend is being assigned, in seconds. Persistence must be configured. |
vip | String | IP of the farm, where the virtual service is listening. |
vport | String | Port of the farm, where the virtual service is listening. An unique port can be especified, a range port can be especified with separator : and several ports can be especified with separator ,. |
Response example:
{
"description" : "Modify farm l4farm",
"params" : {
"algorithm" : "weight",
"nattype" : "nat",
"newfarmname" : "l4farm",
"persistence" : "",
"protocol" : "tcp",
"ttl" : 125,
"vip" : "178.62.126.152",
"vport" : "81"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Modify farm guardian
Modify farm guardian
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"fgtimecheck":5,"fgscript":"Command of Farm Guardian","fgenabled":"true",
"fglog":"true","service":"service1"}' https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms/l4farm/fg
Farmguardian is used for advanced monitoring state of backends and totally personalized for your own scripts for the current service. When a problem is detected by farmguardian automatically disables the real server and will be marked as blacklisted.
PUT /farms/<farmname>/fg
Modify the parameters of the farm guardian in a L4xNAT service.
Request parameters
Field | Type | Description |
---|---|---|
fgenabled | String | Enables the use of farm guardian. true farm guardian is enabled, false farm guardian is disabled. |
fglog | String | Enables the use of logs in farm guardian. fgenabled must be enabled. |
fgscript | String | The command that farm guardian will check. Those available commands are in libexec path. fgenabled must be enabled. |
fgtimecheck | Number | The farm guardian will check each 'timetocheck’ seconds. fgenabled must be enabled. |
Response example:
{
"description" : "Modify farm guardian",
"message" : "Success, some parameters have been changed in farm guardian in farm l4farm.",
"params" : {
"fgenabled" : "true",
"fglog" : "true",
"fgscript" : "check_tcp",
"fgtimecheck" : 5
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
L4xNAT - Backends
List the backends
List the backends
Request example:
curl -k -X GET -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/l4farm/backends
GET /farms/<farmname>/backends
Get the list of backends in a service.
Response example:
{
"description" : "List backends",
"params" : [
{
"id" : 0,
"ip" : "192.5.1.1",
"max_conns" : 400,
"port" : 787,
"priority" : 1,
"status" : "up",
"weight" : 1
},
{
"id" : 1,
"ip" : "192.5.1.3",
"max_conns" : 200,
"port" : 787,
"priority" : 2,
"status" : "up",
"weight" : 1
},
]
}
Response Parameters
This call returns a backend object array with the bellow parameters.
Field | Type | Description |
---|---|---|
id | Number | ID to identificate the backend in the farm. |
ip | String | Backend’s IP where the real service is listening. |
port | Number | Backend’s port where the real service is listening. Empty value is accepted and it will use the same configuration than virtual port(s). |
status | String | Backend status. The possible values are: up, the farm is running and the backend is ready to receive connections; down, the farm is running and the service has detected that the backend is not working; maintenance, backend is marked as not ready for receiving connections by the administrator, this option is useful for backend’s maintance tasks; undefined, the backend status has been not checked. |
max_conns | Number | It’s the maximum number of concurrent connection for the backend. If this field has the value 0, the backend doesn’t have configurated any connection limit. |
priority | Number | It’s the priority value for the current real server. Connections always to the most prio available where 1 is the most priority. |
weight | Number | It’s the weight value for the current real server. Backends with more weight will receive more connections. |
Create a new Backend
Create a new Backend
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.5.100","port":8080,"max_conns":400}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/l4farm/backends
POST /farms/<farmname>/backends
Create a new Backend in a given L4xNAT Farm.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
ip | String | Backend’s IP where the real service is listening. | true |
port | Number | Backend’s port where the real service is listening. Empty value is accepted and it will use the same configuration than virtual port(s). | |
max_conns | Number | It’s the maximum number of concurrent connection for the backend. If this field has the value 0, the backend doesn’t have configurated any connection limit. | |
priority | Number | It’s the priority value for the current real server. Connections always to the most prio available where 1 is the most priority. Default value is 1. | |
weight | Number | It’s the weight value for the current real server. Backends with more weight will receive more connections. Default value is 1. |
Response example:
{
"description" : "New farm backend",
"message" : "Backend added",
"params" : {
"id" : 5,
"ip" : "192.168.5.100",
"port" : 8080,
"max_conns" : 400,
"priority" : null,
"weight" : null
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Modify a Backend
Modify a Backend
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.5.40","port":8080,"max_conns":220,"priority":4,"weight":7}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/l4farm/backends/2
PUT /farms/<farmname>/backends/<id>
Modify the parameters of a backend in a service of a L4xNAT Farm. id is the backend unique identifier.
Request parameters
Field | Type | Description |
---|---|---|
ip | String | Backend’s IP where the real service is listening. |
port | Number | Backend’s port where the real service is listening. Empty value is accepted and it will use the same configuration than virtual port(s). |
max_conns | Number | It’s the maximum number of concurrent connection for the backend. If this field has the value 0, the backend doesn’t have configurated any connection limit. |
priority | Number | It’s the priority value for the current real server. Connections always to the most prio available where 1 is the most priority. |
weight | Number | It’s the weight value for the current real server. Backends with more weight will receive more connections. |
Response example:
{
"description" : "Modify backend",
"message" : "Backend modified",
"params" : {
"ip" : "192.168.5.40",
"port" : 8080,
"max_conns" : 220,
"priority" : 4,
"weight" : 7
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Backend in maintenance
Backend in maintenance
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"action":"maintenance","mode":"cut"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/l4farm/backends/1/maintenance
PUT /farms/<farmname>/backends/<id>/maintenance
Set a given action in a backend of a L4xNAT farm. id is the backend unique identifier.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
action | String | Set the action desired. The actions are: up the backend is ready to receive client requests, maintenance backend is not ready to receive client requests, this action is useful for stopping the backend server without affect to the clients. | true |
mode | String | Choose a maintenance mode. The available options are: drain, the backend doesn’t accept new connections, but it will continue to handle the current connections; or cut, the current connections will be closed. | If this field is not specified, the default mode will be drain. |
Response example:
{
"description" : "Set backend status",
"params" : {
"action" : "maintenance",
"mode" : "cut"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Delete a backend
Delete a backend
Request example:
curl -k -X DELETE -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/l4farm/backends/4
DELETE /farms/<farmname>/backends/<id>
Delete a given backend in a service of a L4xNAT Farm.
id is the backend unique identifier.
Response example:
{
"description" : "Delete backend",
"message" : "Backend removed",
"success" : "true"
}
Datalink Farms
The datalink farm profile allows to create a routes based farm where the backends are uplink routers or gateways. This kind of farm profile is ready to share several uplink WAN router accesses using the load balancer as an uplink channel multiplexor (1 input and several router line outputs). Therefore, the datalink farms could be used as high available communication links and additionally could be used as bandwidth increase joining the amount of bandwidth between the routers backends links.
Retrieve farm by name
Retrieve farm by name
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms/dlink
GET /farms/<farmname>
Show all configuration about a farm.
Response example:
{
"backends" : [
{
"id" : 0,
"interface" : "eth0",
"ip" : "192.168.100.10",
"priority" : 2,
"status" : "undefined",
"weight" : 2
},
{
"id" : 1,
"interface" : "eth0",
"ip" : "192.168.100.11",
"priority" : 2,
"status" : "undefined",
"weight" : 1
}
],
"description" : "List farm dlink",
"params" : {
"algorithm" : "weight",
"status" : "down",
"vip" : "192.168.100.199"
}
}
Response parameters
The response will be a JSON object with the format below.
Farm Object:
Field | Type | Description |
---|---|---|
params | Object | Parameters of farm configuration. |
backends | Object[] | Real servers created in this farm and its configuration. |
Parameters object for datalink farms:
Field | Type | Description |
---|---|---|
algorithm | String | Type of load balancing algorithm used in the Farm. The options are: weight, the balancer distributes among all available backends given more charge backends with higher weight atribute or prio, which sends all connections to the backend with the minor value of priority. |
status | String | Farm status. The available status values are: down, the farm is not running; needed restart, the farm is up but it is pending of a restart action; critical, the farm is up and all backends are unreachable; problem, the farm is up and there are some backend unreachable, but almost a backend is in up status; up, the farm is up and all the backends are working success. |
vip | String | IP of the farm, where the virtual service is listening. |
Backend object for datalink farms:
Field | Type | Description |
---|---|---|
id | Number | Unique identifier for the backend in the farm. |
ip | String | IP of the backend, where the real service is listening. |
interface | String | It’s the local network interface where the backend is connected to. |
priority | Number | It’s the priority value for the current real server. It will be used when algorithm field is configuration as prio and lower priority will have preference |
status | String | Backend status. The possible values are: up, the farm is running and the backend is ready to receive connections; down, the farm is running and the service has detected that the backend is not working; undefined, the backend status has been not checked. |
weight | Number | It’s the weight value for the current real server. It will be used when algorithm field is configuration as weight. |
Create a new Farm
Create a new Farm
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"farmname":"dlink", "vip":"192.168.100.241", "profile":"datalink" }'
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/farms
POST /farms
Create a new datalink farm.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
farmname | String | Farm name, unique identifier. | true |
profile | String | The profile of the created Farm. For datalink farms is datalink | true |
vip | String | IP of the farm, where the virtual service is listening. | true |
Response example:
{
"description" : "Creating farm 'dlink'",
"params" : {
"farmname" : "dlink",
"interface" : "eth0",
"profile" : "datalink",
"vip" : "192.168.100.241"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Modify a Farm
Modify a Farm
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"newfarmname":"dlink2", "vip":"192.168.100.199","algorithm":"weight"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/dlink
PUT /farms/<farmname>
Modify the configuration of a datalink farm.
Request parameters
Field | Type | Description |
---|---|---|
newfarmname | String | The new farm name. Farm must be stopped. |
algorithm | String | Type of load balancing algorithm used in the Farm. The options are: weight, the balancer distributes among all available backends given more charge backends with higher weight atribute or prio, which sends all connections to the backend with the minor value of priority. |
vip | String | IP of the farm, where the virtual service is listening. |
Response example:
{
"description" : "Modify farm dlink",
"params" : {
"algorithm" : "weight",
"vip" : "192.168.100.199",
"newfarmname" : "dlink2"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Datalink - Backends
Backends in datalink farms are the gateways through routing the service. The service will multiplexor among this gateways, and some of them is not available, the service uses the other(s).
List the backends
List the backends
Request example:
curl -k -X GET -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/dlink/backends
GET /farms/<farmname>/backends
Get the list of backends in a service.
Response example:
[
{
"id" : 6,
"interface" : "eth0",
"ip" : "192.168.100.10",
"priority" : 2,
"status" : "undefined",
"weight" : 2
},
{
"id" : 7,
"interface" : "eth0",
"ip" : "192.168.100.11",
"priority" : 2,
"status" : "undefined",
"weight" : 1
}
]
Response Parameters
This call returns a backend object array with the bellow parameters.
Field | Type | Description |
---|---|---|
id | Number | Unique identifier for the backend in the farm. This identifier is generated by the system. |
interface | String | It’s the local network interface where the backend is connected to. |
ip | String | IP of the backend, where the real service is listening. |
priority | Number | It’s the priority value for the current backend. It will be used when algorithm field is configuration as prio and lower priority will have preference. |
status | String | Backend status. The possible values are: up, the farm is running and the backend is ready to receive connections; down, the farm is running and the service has detected that the backend is not working; undefined, the backend status has been not checked. |
weight | Number | It’s the weight value for the current backend. It will be used when algorithm field is configuration as weight. |
Create a new Backend
Create a new Backend
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.100.10","interface":"eth0","priority":2,"weight":2}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/dlink/backends
POST /farms/<farmname>/backends
Create a new Backend in a given datalink Farm.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
ip | String | IP of the backend, where the real service is listening. | true |
interface | String | It’s the local network interface where the backend is connected to. | true |
priority | Number | It’s the priority value for the current real server.It will be used when algorithm field is configuration as prio and lower priority will have preference. Default value is 1. | |
weight | Number | It’s the weight value for the current backend. It will be used when algorithm field is configuration as weight. Default value is 1. |
Response example:
{
"description" : "New farm backend",
"message" : "Backend added",
"params" : {
"id" : 6,
"interface" : "eth0",
"ip" : "192.168.100.10",
"priority" : 2,
"weight" : 2
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Modify a Backend
Modify a Backend
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.102.50","interface":"eth0", "weight":1,"timeout":1}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/datalink/backends/2
PUT /farms/<farmname>/backends/<id>
Modify the parameters of a backend in a service of a datalink Farm. id is the backend unique identifier.
Request parameters
Field | Type | Description |
---|---|---|
String | ip | IP of the backend, where the real service is listening. |
interface | String | It’s the local network interface where the backend is connected to. |
timeout | Number | It’s the backend timeout to respond a certain request. |
weight | Number | It’s the weight value for the current backend. |
Response example:
{
"description" : "Modify backend",
"message" : "Backend modified",
"params" : {
"interface" : "eth0",
"ip" : "192.168.102.50",
"timeout" : 1,
"weight" : 1
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Delete a backend
Delete a backend
Request example:
curl -k -X DELETE -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/farms/dlink/backends/4
DELETE /farms/<farmname>/backends/<id>
Delete a given backend in a service of a datalink Farm. id is the backend unique identifier.
Response example:
{
"description" : "Delete backend",
"message" : "Backend removed",
"success" : "true"
}
Network
Zevenet can work with different types of network interfaces.
In this section you can list, create, configure, delete and set an action in NIC, VLAN and virtual interfaces.
nic: or network interface card, it is a computer hardware component and tis kind of interface is the base for the following kind of interfaces that can be defined and managed in Zevenet.
vlan: or virtual lan card is kind or network interface that provide network segmentation services. More than one vlan can be created through a nic interface.
virtual: This kind of interface can be created over any kind of interface describew above. This kind of interface should be used for Farms and it is required that the virtual interface is defined in the same subnet than the parent.
List all interfaces
List all interfaces
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/nic
GET /interfaces
Get a list of interfaces in the system with their configuration.
Response example:
{
"description" : "List interfaces",
"interfaces" : [
{
"gateway" : "192.168.100.5",
"has_vlan" : "true",
"ip" : "192.168.100.241",
"mac" : "c2:56:f6:54:ff:a0",
"name" : "eth0",
"netmask" : "255.255.255.0",
"status" : "up",
"type" : "nic"
},
{
"gateway" : "192.168.120.1",
"ip" : "192.168.120.120",
"mac" : "c2:56:f6:54:ff:a0",
"name" : "eth0.1",
"netmask" : "255.255.255.0",
"status" : "down",
"type" : "vlan"
},
{
"gateway" : "",
"ip" : "192.168.100.155",
"mac" : "c2:56:f6:54:ff:a0",
"name" : "eth0:virt",
"netmask" : "255.255.255.0",
"status" : "up",
"type" : "virtual"
},
{
"gateway" : "192.168.100.5",
"has_vlan" : "false",
"ip" : "192.168.100.102",
"mac" : "62:30:43:36:29:ac",
"name" : "eth1",
"netmask" : "255.255.255.0",
"status" : "up",
"type" : "nic"
}
]
}
Response parameters
The response will be a JSON object with an interface object array.
Interface object:
Field | Type | Description |
---|---|---|
ip | String | IP of the interface. IP must be in same network segment than parent interface in virtual interface. |
has_vlan | String | This field shows if this interface is parent of a VLAN interface. This field is only for NIC interfaces. |
netmask | String | Netmask of the interface. This value could not be modified in virtual interfaces, it is inherited from parent inteface. |
gateway | String | Gateway of the interface. This value could not be modified in virtual interfaces, it is inherited from parent inteface. |
mac | String | MAC of the interface. This value is inherited from parent interface. |
name | String | Interface’s name. It is used as unique identifier. |
status | String | The values can be up, the interface can receive packets; down, the interface can not receive packets. |
type | String | The different kind of interfaces are: nic, vlan or virtual. |
Retrieve default gateway
Retrieve default gateway
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/interfaces/gateway
GET /interfaces/gateway
The default gateway is the node which to sending all destination traffic that does not reachable locally from any interface in the load balancer.
Get the parameters of the default gateway interface.
Response example:
{
"description" : "Default gateway",
"params" : {
"address" : "192.168.100.5",
"interface" : "eth0"
}
}
Response parameters
Field | Type | Description |
---|---|---|
address | String | It is the IP of the gateway. |
interface | String | Interface name for the gateway. |
Modify default gateway
Modify default gateway
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"interface":"eth0","address":"192.168.100.5"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces
PUT /interfaces/gateway
Modify the configuration of the gateway interface.
Response example:
{
"description" : "Modify default gateway",
"message" : "The default gateway has been changed successfully",
"success" : "true"
}
Request parameters
Field | Type | Description |
---|---|---|
address | String | It is the IP of the gateway. |
interface | String | Interface name for the gateway. |
Delete gateway configuration
DELETE /interfaces/gateway
Delete the configuration of the default gateway configuration.
Warning: if the gateway is disconfigured, Zevenet is not going to be reachable from a external network segment.
Delete gateway configuration
Request example:
curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/gateway
Response message
If the gateway is disconfigure from the same network segment, this message will appear, else the connection will lose.
Response example:
{
"description" : "Remove default gateway",
"message" : "The default gateway has been deleted successfully",
"params" : {
"address" : null,
"interface" : null
}
}
Network - NIC interfaces
NIC interfaces are the physical interfaces connected to your Zevenet load balancer.
The system recognizes new interfaces automatically once they are connected.
Using NIC interfaces as parents, other type of interfaces with different characteristics can be created. Available interfaces are: VLAN and virtual.
List NIC interfaces
GET /interfaces/nic
Get all the parameters of the NIC interfaces.
List NIC interfaces
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/nic
Response example:
{
"description" : "List NIC interfaces",
"interfaces" : [
{
"gateway" : "192.168.100.5",
"has_vlan" : "true",
"ip" : "192.168.100.241",
"is_slave" : "false",
"mac" : "c2:56:f6:54:ff:a0",
"name" : "eth0",
"netmask" : "255.255.255.0",
"status" : "up"
},
{
"gateway" : "192.168.100.5",
"has_vlan" : "false",
"ip" : "192.168.100.102",
"mac" : "62:30:43:36:29:ac",
"name" : "eth1",
"netmask" : "255.255.255.0",
"status" : "up"
}
]
}
Response parameters
The response will be a JSON object with an array of NIC interface objects.
NIC interface object:
Field | Type | Description |
---|---|---|
ip | String | IP of the interface. |
has_vlan | String | This field shows if this interface is parent of a VLAN interface. This field is only for NIC interfaces. |
netmask | String | Define the network segment where the interface is working. |
gateway | String | IP used to send packets to a different network segment. |
mac | String | Link layer unique indentifier. It is unmodifiable. |
name | String | Interface’s name. It is used as interface unique identifier. |
status | String | The values can be up, the interface can receive packets; down, the interface can not receive packets. |
Retrieve NIC interface
Retrieve NIC interface
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/nic/eth1
GET /interfaces/nic/<name>
Get all the parameters of a NIC interface. name is the interface unique identifier.
Response example:
{
"description" : "Show NIC interface",
"interface" : {
"gateway" : "192.168.100.5",
"ip" : "192.168.100.102",
"mac" : "62:30:43:36:29:ac",
"name" : "eth1",
"netmask" : "255.255.255.0",
"status" : "up"
}
}
Response parameters
Field | Type | Description |
---|---|---|
ip | String | IP of the interface. |
netmask | String | Define the network segment where the interface is working. |
gateway | String | IP used to send packets to a different network segment. |
mac | String | Link layer unique indentifier. It is unmodifiable. |
name | String | Interface’s name. It is used as interface unique identifier. |
status | String | The values can be up, the interface can receive packets; down, the interface can not receive packets. |
Modify NIC interface
Modify NIC interface
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.100.102","netmask":"255.255.255.0","gateway":"192.168.100.5"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/nic/eth1
PUT /interfaces/nic/<name>
Modify the parameters of a NIC interface. name is the interface unique identifier.
Request parameters
Field | Type | Description |
---|---|---|
ip | String | IP of the interface. |
netmask | String | Define the network segment where the interface is working. |
gateway | String | IP used to send packets of a different network segment. |
Response example:
{
"description" : "Configure nic interface",
"params" : {
"gateway" : "192.168.100.5",
"ip" : "192.168.100.102",
"netmask" : "255.255.255.0"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Delete NIC configuration
Delete NIC configuration
Request example:
curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/nic/eth3
DELETE /interfaces/nic/<name>
Delete the configuration for a NIC interface. After this action, the interface will be useless, and ready to be configured again. name is the interface unique identifier.
Response example:
{
"description" : "Delete nic interface",
"message" : "The configuration for the network interface eth3 has been deleted.",
"success" : "true"
}
Set NIC interface action
Set NIC interface action
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"action":"down"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/nic/eth1/actions
POST /interfaces/nic/<name>/actions
Apply an action to a NIC interface. This call lets enable or disable a network interface.
name is the interface unique identifier.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
action | String | Action to apply to the interface. The available values are: up, enable the interface and prepare it for being used; down, disable the interface to not receive or not send packets. | true |
Response example:
{
"description" : "Action on nic interface",
"params" : {
"action" : "up"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Network - VLAN interfaces
VLAN interface lets a NIC interface works in another network, so the IP, gateway and netmask fields could be different of the parent interface. VLAN interface inherits the MAC address from its parent interface.
The VLAN interfaces field name will appear with a dot “.” character that will be used to establish an identifier tag for the VLAN interface.
List VLAN interfaces
List VLAN interfaces
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/vlan
GET /interfaces/vlan
Get all parameters of VLAN interfaces.
Response example:
{
"description" : "List VLAN interfaces",
"interfaces" : [
{
"gateway" : "192.168.120.1",
"ip" : "192.168.120.120",
"mac" : "c2:56:f6:54:ff:a0",
"name" : "eth0.1",
"netmask" : "255.255.255.0",
"parent" : "eth0",
"status" : "down"
}
]
}
Response parameters
The response will be a JSON object with a VLAN interface object array.
The VLAN parameters are:
Field | Type | Description |
---|---|---|
ip | String | IP of the interface. It can be different to the parent inteface IP. |
netmask | String | Define the network segment where the interface is working. |
gateway | String | IP used to send packets of a different network segment. |
mac | String | MAC of the interface. This value is inherited from the parent interface. |
name | String | Interface’s name. It is used as unique identifier. This name is a chain formated by a parent interface name, a dot character “.” and a number for the vlan network interface or vlan tag. |
parent | String | It is the Interface used to create this one. |
status | String | The values can be up the interface can receive packets, down the interface can not receive packets. |
Retrieve VLAN interface
Retrieve VLAN interface
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/vlan/eth0.1
GET /interfaces/vlan/<name>
Get all parameters of the VLAN interface. name is the interface unique identifier.
Response example:
{
"description" : "Show VLAN interface",
"interface" : {
"gateway" : "192.168.131.1",
"ip" : "192.168.131.155",
"mac" : "c2:56:f6:54:ff:a0",
"name" : "eth0.1",
"netmask" : "255.255.255.0",
"status" : "up"
}
}
Response parameters
Field | Type | Description |
---|---|---|
ip | String | IP of the interface. |
netmask | String | Define the network segment where the interface is working. |
gateway | String | IP used to send packets of a different network segment. |
mac | String | MAC of the interface. This value is inherited from the parent interface. |
name | String | Interface’s name. It is used as unique identifier. This name is a chain formated by a parent interface name, a dot character “.” and a number for the vlan network interface. |
status | String | The values can be up the interface can receive packets, down the interface can not receive packets. |
Create VLAN interface
Create VLAN interface
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.120.120","netmask":"255.255.255.0","gateway":"192.168.120.1", "name":"eth0.1"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/vlan
POST /interfaces/vlan
Create a VLAN interface from a NIC interface. The new VLAN interface will share MAC, although the following network parameters must be different: ip, and the following can change: gateway, netmask.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
ip | String | IP of the interface. It must be different to the parent inteface IP. | true |
netmask | String | Define the network segment where the interface is working. | true |
gateway | String | IP used to send packets of a different network segment. | true |
name | String | Interface’s name. It is used as unique identifier. This name is a chain formated by a parent interface name, a dot character “.” and a number for the vlan network interface. | true |
Response example:
{
"description" : "Add a vlan interface",
"params" : {
"gateway" : "192.168.120.1",
"ip" : "192.168.120.120",
"mac" : null,
"name" : "eth0.1",
"netmask" : "255.255.255.0"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Modify VLAN interface
Modify VLAN interface
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.131.155","netmask":"255.255.255.0","gateway":"192.168.131.1"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/vlan/eth0.1
PUT /interfaces/vlan/<name>
Modify the parameters of a VLAN interface. name is the interface unique identifier.
Request parameters
Field | Type | Description |
---|---|---|
ip | String | IP of the interface. It can be different to the parent inteface IP. |
netmask | String | Define the network segment where the interface is working. |
gateway | String | IP used to send packets of a different network segment. |
Response example:
{
"description" : "Modify VLAN interface",
"params" : {
"gateway" : "192.168.131.1",
"ip" : "192.168.131.155",
"netmask" : "255.255.255.0"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Delete VLAN interface
Delete VLAN interface
Request example:
curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/vlan/eth0.1
DELETE /interfaces/vlan/<name>
Delete a VLAN interface. name is the interface unique identifier.
Response example:
{
"description" : "Delete VLAN interface",
"message" : "The VLAN interface eth0.1 has been deleted.",
"success" : "true"
}
Set VLAN interface action
Set VLAN interface action
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"action":"down"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/vlan/eth0.1/actions
POST /interfaces/vlan/<name>/actions
Apply an action to a VLAN interface. This call lets enable or disable a network interface.
name is the name unique identifier.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
action | String | Action to apply to the interface. The available values are: up, enable the interface and prepare it for being used; down, disable the interface to not receive or not send packets. | true |
Response example:
{
"description" : "Action on vlan interface",
"params" : {
"action" : "down"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Network - Virtual interfaces
Network interfaces lets users to have another network interface in the same network segment than parent, so virtual interfaces always inherit the network configuration from its parent. The different parameter will be the ip. Virtual interface can be created from NIC or VLAN. Creating a new virtual interface will appear a field with a colon “:” character that will be used to establish an identification for the virtual interface.
List Virtual interfaces
List Virtual interfaces
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/virtual
GET /interfaces/virtual
Get all parameters of virtual interfaces.
Response example:
{
"description" : "List virtual interfaces",
"interfaces" : [
{
"gateway" : "",
"ip" : "192.168.100.155",
"mac" : "c2:56:f6:54:ff:a0",
"name" : "eth0:virt",
"netmask" : "255.255.255.0",
"parent" : "eth0",
"status" : "up"
},
{
"gateway" : "192.168.100.5",
"ip" : "192.168.100.41",
"mac" : "c2:56:f6:54:ff:a0",
"name" : "eth0:virtiface",
"netmask" : "255.255.255.0",
"parent" : "eth0",
"status" : "down"
}
]
}
Response parameters
Field | Type | Description |
---|---|---|
ip | String | IP of the interface. The IP must be in same network segment than parent interface. |
netmask | String | Define the network segment where the interface is working. It inherits from parent interface. |
gateway | String | IP used to send packets of a different network segment. It inherits from parent interface. |
mac | String | MAC of the interface. It inherits from parent interface. |
name | String | Interface’s name. It is used as unique identifier. This name is a chain formated by a parent interface, a colon character “:” and the name for the virtual network interface, alphanumeric characters are allowed. |
parent | String | It is the Interface used to create this one. |
status | String | The values can be up, the interface can receive packets; down, the interface can not receive packets. |
Retrieve virtual interface
Retrieve virtual interface
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/virtual/eth0:virtiface
GET /interfaces/virtual/<name>
Get all parameters of a virtual interface. name is the interface unique identifier.
Response example:
{
"description" : "Show virtual interface",
"interface" : {
"gateway" : "192.168.100.5",
"ip" : "192.168.100.41",
"mac" : "c2:56:f6:54:ff:a0",
"name" : "eth0:virtiface",
"netmask" : "255.255.255.0",
"status" : "down"
}
}
Response parameters
Field | Type | Description |
---|---|---|
ip | String | IP of the interface. The IP must be in same network segment than parent interface. |
netmask | String | Define the network segment where the interface is working. It inherits from parent interface. |
gateway | String | IP used to send packets of a different network segment. It inherits from parent interface. |
mac | String | MAC of the interface. It inherits from parent interface. |
name | String | Interface’s name. It is used as unique identifier. This name is a chain formated by a parent interface, a colon character “:” and an alphanumeric string for the virtual network interface. |
status | String | The values can be up, the interface can receive packets; down, the interface can not receive packets. |
Create virtual interface
Create virtual interface
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.100.41", "name":"eth0:virtiface"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/virtual
POST /interfaces/virtual
Create a virtual interface.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
ip | String | IP of the interface. The IP must be in same network segment than parent interface. | true |
name | String | Interface’s name. It is used as unique identifier. This name is a chain formated by a parent interface, a colon character “:” and an alphanumeric string for the virtual network interface. | true |
Response example:
{
"description" : "Add a virtual interface",
"params" : {
"gateway" : "192.168.100.5",
"ip" : "192.168.100.41",
"mac" : "c2:56:f6:54:ff:a0",
"name" : "eth0:virtiface",
"netmask" : "255.255.255.0"
}
}
Response parameters
The response will be a json with the interface configuration. See response example for more information.
Field | Type | Description |
---|---|---|
ip | String | IP of the interface. The IP must be in same network segment than parent interface. |
netmask | String | Define the network segment where the interface is working. It inherits from parent interface. |
gateway | String | IP used to send packets to a different network segment. It inherits from parent interface. |
mac | String | MAC of the interface. It inherits from parent interface. |
name | String | Interface’s name. It is used as unique identifier. This name is a chain formated by a parent interface, a colon character “:” and a alpahnumeric string for the virtual network interface. |
Modify virtual interface
Modify virtual interface
Request example:
curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.131.155"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/virtual/eth0:virtiface
PUT /interfaces/virtual/<name>
Modify the parameters of a virtual interface. name is the interface unique identifier.
Request parameters
Field | Type | Description |
---|---|---|
ip | String | IP of the interface. The IP must be in same network segment than parent interface. |
Response example:
{
"description" : "Modify virtual interface",
"params" : {
"ip" : "192.168.100.10"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Delete virtual interface
Delete virtual interface
Request example:
curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/virtual/eth0:virtiface
DELETE /interfaces/virtual/<name>
Delete a virtual interfaces. name is the interface unique identifier.
Response example:
{
"description" : "Delete virtual interface",
"message" : "The virtual interface eth0:virtiface has been deleted.",
"success" : "true"
}
Set Virtual interface action
Set Virtual interface action
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"action":"down"}'
https://<zenlb_server>:444/zapi/v3.1/zapi.cgi/interfaces/virtual/eth0:virtiface/actions
POST /interfaces/virtual/<name>/actions
Apply an action to a virtual interface. This call lets enable or disable a network interface.
name is the interface unique identifier.
Request parameters
Field | Type | Description | Required |
---|---|---|---|
action | String | Action to apply to the interface. The available values are: up, enable the interface and prepare it for being used; down, disable the interface to not receive or not send packets. | true |
Response example:
{
"description" : "Action on virtual interface",
"params" : {
"action" : "down"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Monitoring - Statistics
Show information about system and farms. This information will be useful to monitorize the Zevenet load balancer status.
Show system statistics
Show system statistics
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/stats
GET /stats
Get global system statistics.
Response example:
{
"description" : "System stats",
"params" : {
"cpu" : {
"cores" : 2,
"idle" : 94.42,
"iowait" : 0,
"irq" : 0,
"nice" : 0,
"softirq" : 0,
"sys" : 2.54,
"usage" : 5.58,
"user" : 3.05
},
"date" : "Fri Jan 27 11:40:32 2017",
"hostname" : "api3",
"load" : {
"Last_1" : 1.17,
"Last_15" : 0.36,
"Last_5" : 0.6
},
"memory" : {
"Buffers" : 21.68,
"Cached" : 147.95,
"MemFree" : 348.06,
"MemTotal" : 2005.01,
"MemUsed" : 1656.95,
"SwapCached" : 2.67,
"SwapFree" : 614.38,
"SwapTotal" : 672,
"SwapUsed" : 57.62
},
"network" : {
"eth0 in in" : 2702.29,
"eth0 out out" : 50701.95,
"eth0.1 in in" : 0,
"eth0.1 out out" : 0,
"eth1 in in" : 234.72,
"eth1 out out" : 0,
}
}
}
Response parameters
Field | Type | Description |
---|---|---|
cpu | Object | CPU statistics. |
date | String | System date. |
hostname | String | Host’s name. |
load | Object | Core load statistics. |
memory | Object | Used memory statistics. |
network | Object | Network traffic statistics. |
CPU object:
Field | Type | Description |
---|---|---|
cores | Number | Number of cores in the processor. |
idle | Number | CPU not use by any program. |
iowait | Number | CPU used by input or output process. |
irq | Number | CPU used by hardware interrrupcions. |
nice | Number | CPU scheduling priority. |
softirq | Number | CPU used by software interrrupcions. |
sys | Number | CPU used by the system. |
usage | Number | Total CPU used. |
user | Number | CPU used by the user. |
Load object:
Field | Type | Description |
---|---|---|
Last_1 | Number | Load system porcentage the last minute. |
Last_5 | Number | Load system porcentage five minutes ago. |
Last_15 | Number | Load system porcentage fifteen minutes ago. |
Memory object.
Field | Type | Description |
---|---|---|
Buffers | Number | It’s the memory used by the buffers. This amount is indicated in Mb. |
Cached | Number | It’s the total memory cached by the system. This amount is indicated in Mb. |
MemFree | Number | It’s the total free memory not cached by the system. This amount is indicated in Mb. |
MemTotal | Number | It’s the total ram memory on the system. This amount is indicated in Mb. |
MemUsed | Number | It’s the memory used by the system. This amount is indicated in Mb. |
SwapCached | Number | It’s the total cache memory reserved. |
SwapFree | Number | It’s the total free memory not cached by the system. This amount is indicated in Mb. |
SwapTotal | Number | It’s the total swap memory reserved. |
SwapUsed | Number | It’s the swap used memory by the system, on optimal systems should be 0. |
Network object:
Field | Type | Description |
---|---|---|
<interface> in in | Number | Input traffic for this interface. |
<interface> out out | Number | Output traffic for this interface. |
Show network statistics
Show network statistics
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/stats/system/network
GET /stats/system/network
Get a summary of total input and output traffic through a network interface.
Response example:
{
"description" : "Network interfaces usage",
"params" : {
"date" : "Fri Jan 27 11:58:05 2017",
"hostname" : "api3",
"interfaces" : [
{
"in" : "2703.88",
"interface" : "eth0",
"out" : "50917.65"
},
{
"in" : "815.69",
"interface" : "eth0.1",
"out" : "4300.38"
}
]
}
}
Response parameters
The response will be a JSON with a key params whose value is an object with the followeing keys:
Field | Type | Description |
---|---|---|
date | String | System date. |
hostname | String | Host’s name. |
interfaces | Object[] | Network traffic statistics. |
Interfaces object
Field | Type | Description |
---|---|---|
in | String | Total input traffic in MB. |
interface | String | Interface name. |
out | String | Total output trafficin MB. |
Show farms statistics
Show farms statistics
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/stats/farms
GET /stats/farms
Get a summary of connections and configuration for all farms in the system.
Response example:
{
"description" : "List all farms stats",
"farms" : [
{
"established" : 0,
"farmname" : "testHttps",
"pending" : 0,
"profile" : "https",
"status" : "up",
"vip" : "192.168.101.20",
"vport" : "120"
},
{
"established" : 0,
"farmname" : "httpFarm",
"pending" : 0,
"profile" : "http",
"status" : "up",
"vip" : "192.168.10.31",
"vport" : "8080"
},
{
"established" : 0,
"farmname" : "testDL",
"pending" : 0,
"profile" : "datalink",
"status" : "up",
"vip" : "192.168.102.72",
"vport" : "eth1"
},
{
"established" : 0,
"farmname" : "testL4",
"pending" : 0,
"profile" : "l4xnat",
"status" : "up",
"vip" : "192.168.10.31",
"vport" : "30"
}
]
}
Response parameters
Field | Type | Description |
---|---|---|
established | Number | Total number of current established connections. |
farmname | String | Farm name, unique identifier. |
pending | Number | Number of pending connections. |
profile | String | Type of farm. The possible values are: datalink, l4xnat, http or https. Each profile is defined in its section. |
status | String | Farm status. The available status values are: down, the farm is not running; needed restart, the farm is up but it is pending of a restart action; critical, the farm is up and all backends are unreachable or maintenance; problem, the farm is up and there are some backend unreachable, but almost a backend is in up status; maintenance, the farm is up and there are backends in up status, but almost a backend is in maintenance mode; up, the farm is up and all the backends are working success. |
vip | String | IP of the farm, where the virtual service is listening. |
vport | String | Port of the farm, where the virtual service is listening. |
Show a farm statistics
Show a farm statistics
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/stats/farms/httpFarm
GET /stats/farms/<farmname>
Shows the current farm status, theirs backend status and connections. Each farm will response with different object, depending of the profile.
Response example for HTTP farm:
{
"backends" : [
{
"established" : 0,
"id" : 0,
"ip" : "192.168.0.168",
"pending" : 0,
"port" : 80,
"service" : "srv1",
"status" : "up"
}
],
"description" : "List farm stats",
"sessions" : [
{
"client" : "0",
"id" : "0",
"service" : "srv1",
"session" : "192.168.0.186"
}
]
}
Response parameters in HTTP farms
Field | Type | Description |
---|---|---|
backends | Object[] | Show information about backends. |
sessions | Object[] | Show information about sessions. |
Backend Object
Field | Type | Description |
---|---|---|
established | Number | Total number of established connections. |
id | Number | Backend unique identifier. |
ip | String | IP where the real service is listening. |
pending | Number | Number of pending connections. |
port | Number | Port where the real service is listening. |
service | String | Service name used as unique identifier. |
status | String | Backend status. The possible values are: up, the farm is running and the backend is ready to receive connections; down, the farm is running and the service has detected that the backend is not working; maintenance, backend is marked as not ready for receiving connections by the administrator, this option is useful for backend’s maintance tasks; undefined, the backend status has been not checked. |
Session Object
Field | Type | Description |
---|---|---|
client | String | Client unique identifier. |
id | String | Backend unique identifier assigned to the client. |
service | String | Service unique identifier assigned to the client. |
session | String | Session unique identifier. This value depend of the persistence type. |
Response example for L4xNAT farm:
{
"backends" : [
{
"established" : 5,
"id" : 1,
"ip" : "192.168.5.40",
"pending" : 0,
"port" : "8080",
"status" : "maintenance"
},
{
"established" : null,
"id" : 3,
"ip" : "192.5.1.1",
"pending" : 0,
"port" : "787",
"status" : "down"
},
{
"established" : null,
"id" : 5,
"ip" : "192.168.5.100",
"pending" : 0,
"port" : "8080",
"status" : "up"
}
],
"description" : "List farm stats"
}
Response parameters in L4xNAT farms
The response will be a JSON with key backends and value an object array with the below parameters.
Backend object:
Field | Type | Description |
---|---|---|
established | Number | Total number of current established connections. |
id | Number | Backend unique identifier. |
ip | String | IP where the real service is listening. |
pending | Number | Number of pending connections. |
port | Number | Port where the real service is listening. |
status | String | Backend status. The possible values are: up, the farm is running and the backend is ready to receive connections; down, the farm is running and the service has detected that the backend is not working; maintenance, backend is marked as not ready for receiving connections by the administrator, this option is useful for backend’s maintance tasks; undefined, the backend status has been not checked. |
Response parameters in datalink farms
Datalink farms statistics is not available actually.
Monitoring - Graphs
This section is useful to monitorize the internal load balancer system to detect problems through the parameters of CPU usage, swap memory, ram memory, all configured nework interfaces, load and hard disk storage.
Also, you’ll be able to access to the weekly, mothly and yearly history.
Graphs with information are responded in base64 format.
List available graphs
List available graphs
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/graphs
GET /graphs
Show an object with all available graphs in the system. It shows the possible request that can be made.
Response example:
{
"description" : "These are the possible graphs, you`ll be able to access to the daily, weekly, monthly or yearly graph",
"farms" : [
"l4farm",
"newfarm",
"nwl4farm",
"httpweb"
],
"interfaces" : [
"eth0.1",
"eth1",
"eth0"
],
"system" : [
"cpu",
"load",
"ram",
"swap",
{
"disk" : [
"root/",
"root/boot",
"root/usr/local/zenloadbalancer/config",
"root/var/log"
]
}
]
}
Response parameters
The response will be a JSON three types of graphs, farms, interfaces and system.
Field | Type | Description |
---|---|---|
farms | String[] | List of farm graphs availables. |
interfaces | String[] | List of interfaces graphs availables. |
system | Object[] | List of system graphs availables. The array has an object with an array wich it indicates disk mount points. |
System object:
System object contains an array list related with the system, and a disk object with the next format.
Field | Type | Description |
---|---|---|
disk | String[] | The values of this array are all existing mount points in the system, each one has available graphs. |
Show graphs
Show graphs
Request example for a farm:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/graphs/farms/httpweb
Request example for an interface:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/graphs/interfaces/eth0
Request example for a disk:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/graphs/system/disk/root/boot
GET /graphs/<graph>
The available values for graph are:
Value | Description |
---|---|
farms/<farmname> |
farmname, farm unique identifier. |
interfaces/<interface> |
interface, interface unique identifier. |
system/<system> |
system, possible system graphs are: cpu, load, ram or swap. |
system/disk/<mount point> |
mount point, is a value of disk object, returned by ‘GET /graphs’ call. |
Response example:
{
"description" : "Get cpu graphs",
"graphs" : [
{
"frequency" : "daily",
"graph" : "PNG IN BASE 64"
},
{
"frequency" : "weekly",
"graph" : "PNG IN BASE 64"
},
{
"frequency" : "monthly",
"graph" : "PNG IN BASE 64"
},
{
"frequency" : "yearly",
"graph" : "PNG IN BASE 64"
}
]
}
Response parameters
Field | Type | Description |
---|---|---|
frequency | String | Time period used to generate the graph. The possible values are: daily, weekly, monthly or yearly. |
graphs | String | Graph in base 64 format. |
Show frequency graph
Show frequency graph
Request example for a farm:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/graphs/farms/httpweb/daily
Request example for an interface:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/graphs/interfaces/eth0/monthly
Request example for a disk:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/graphs/system/disk/root/boot/yearly
GET /graphs/<graph>/<frequency>
The available values for graph are:
Value | Description |
---|---|
farms/<farmname> |
farmname, farm unique identifier. |
interfaces/<interface> |
interface, interface unique identifier. |
system/<system> |
system, possible system graphs are: cpu, load, ram or swap. |
system/disk/<mount point> |
mount point, is a value of disk object, returned by 'GET /graphs’ call. |
The available values for frequency are:
Field | Type | Description |
---|---|---|
frequency | String | Time period used to generate the graph. The possible values are: daily, weekly, monthly or yearly. |
Response example:
{
"description" : "Get farm graphs",
"graph" : "PNG IN BASE 64"
}
Response parameters
Field | Type | Description |
---|---|---|
graphs | String | Graph in base 64 format. |
System
System options offer you the possibility of personalizate the services running in the balancer and the global parameters.
Show version
Show version
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/version
GET /system/version
Show informacion about the product version.
Response example:
{
"description" : "Get version",
"params" : {
"appliance_version" : "ZVA 4100, hypervisor: xen",
"hostname" : "DEV5",
"kernel_version" : "3.16.7-ckt20",
"system_date" : "Thu Feb 2 10:34:27 2017",
"zevenet_version" : "5.0"
}
}
Response parameters
The response will be a JSON object with the below parameters.
Field | Type | Description |
---|---|---|
appliance_version | String | Applicance version. Show also hypervisor if is a virtual machine. |
hostname | String | Host name. |
kernel_version | String | Linux kernel version. |
system_date | String | System date. |
zevenet_version | String | Zevenet Community Edition version. |
Show DNS
Show DNS
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/dns
GET /system/dns
Show the DNS service configuration.
Response example:
{
"description" : "Get dns",
"params" : {
"primary" : "8.8.8.8",
"secondary" : null
}
}
Response parameters
The response will be a JSON object with the below parameters.
Field | Type | Description |
---|---|---|
primary | String | Primary DNS configurated in system. |
secondary | String | Secondary DNS configurated in system. |
Modify DNS
Modify DNS
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"primary":"8.8.4.4","secondary":"8.8.8.8"}'
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/dns
POST /system/dns
Modify the DNS service configuration.
Request parameters
Field | Type | Description |
---|---|---|
primary | String | Primary DNS configurated in system. |
secondary | String | Secondary DNS configurated in system. |
Response example:
{
"description" : "Post dns",
"params" : {
"primary" : "8.8.4.4",
"secondary" : "8.8.8.8"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Show SNMP
Show SNMP
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/snmp
GET /system/snmp
Show the SNMP service configuration.
Response example:
{
"description" : "Get snmp",
"params" : {
"community" : "public",
"ip" : "*",
"port" : "161",
"scope" : "0.0.0.0/0",
"status" : "false"
}
}
Response parameters
The response will be a JSON object with the below parameters.
Field | Type | Description |
---|---|---|
community | String | Community name. Read Only Community used. |
ip | String | Interface IP where the SNMP service is running. It’s safe to keep the All interfaces enabled using the character *. |
port | String | Port where SNMP service is running. |
scope | String | IP or subnet with access (IP/bit). Allowed client IPs to acces SNMPD service, in case you want to allow access only one IP please use the bit “/32”. |
status | String | Status of SNMP service. The possible values are: true, the service is running; or false, the service is stopped. |
Modify SNMP
Modify SNMP
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"ip":"192.168.100.241","port":"170","scope":"0.0.0.0/0","status":"true","community":"public"}'
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/snmp
POST /system/snmp
Modify the SNMP service configuration.
Request parameters
Field | Type | Description |
---|---|---|
community | String | Community name. Read Only Community used. |
ip | String | Interface IP where the SNMP service is running. It’s safe to keep the All interfaces enabled using the character *. |
port | String | Port where SNMP service is running. |
scope | String | IP or subnet with access (IP/bit). Allowed client IPs to acces SNMPD service, in case you want to allow access only one IP please use the bit “/32”. |
status | String | Status of SNMP service. The possible values are: true, the service is running; or false, the service is stopped. |
Response example:
{
"description" : "Post snmp",
"params" : {
"community" : "public",
"ip" : "192.168.100.241",
"port" : "170",
"scope" : "0.0.0.0/0",
"status" : "true"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Retrieve license
Retrieve license
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/license/txt
GET /system/license/<format>
Show the Zevenet license in a format. The available format values are html or txt.
Show NTP
Show NTP
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/ntp
GET /system/ntp
Show the NTP service configuration.
Response example:
{
"description" : "Get ntp",
"params" : {
"server" : "pool.ntp.org"
}
}
Response parameters
The response will be a JSON object with the below parameters.
Field | Type | Description |
---|---|---|
server | String | Server where NTP client does the requests. |
Modify NTP
Modify NTP
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"server":"pool.ntp.org"}'
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/ntp
POST /system/ntp
Modify the NTP service configuration.
Request parameters
Field | Type | Description |
---|---|---|
server | String | Server where NTP client does the requests. |
Response example:
{
"description" : "Post ntp",
"params" : "pool.ntp.org"
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
List all users
List all users
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/users
GET /system/users
List the available users in the system.
Response example:
{
"description" : "Get users",
"params" : [
{
"status" : "true",
"user" : "root"
},
{
"status" : "true",
"user" : "zapi"
}
]
}
Response parameters
The response will be a JSON object with an array of the below parameters.
Field | Type | Description |
---|---|---|
status | String | User status. The possible values are: true, the user is activated; or not false, the user is desactivated. |
user | String | User name. |
Retrieve zapi user
Retrieve zapi user
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/users/zapi
GET /system/users/zapi
Show the zapi user configuration. This parameters are neccessary to access to Zevenet services through zapi.
Response example:
{
"description" : "Zapi user configuration.",
"params" : {
"key" : "root",
"status" : "true"
}
}
Response parameters
The response will be a JSON object with an array of the below parameters.
Field | Type | Description |
---|---|---|
key | String | Key to authenticate in zapi. This is the parameter ZAPI_KEY used in calls to the zapi. |
status | String | Zapi user status. If its value is true, it is possible to use the zapi; or not false, the zapi is desactivated and it is not possible send it request. |
Modify zapi user configuration
Modify zapi user configuration
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"key":"newzapikey","status":"enable","newpassword":"password1234"}'
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/users/zapi
POST /system/users/zapi
Modify the zapi user configuration. This parameters are neccessary to access to Zevenet services through zapi.
Request parameters
Field | Type | Description |
---|---|---|
key | String | Key to authenticate in zapi. This is the parameter ZAPI_KEY used in calls to the zapi. |
newpassword | String | New password for zapi user. |
status | String | Zapi user status. The possible values are: enable to enable zapi user or disable to disable zapi user. If the zapi user is disabled, you will not be able to send requests. |
Response example:
{
"description" : "Zapi user settings.",
"message" : "Settings was changed successful.",
"params" : {
"key" : "newzapikey",
"newpassword" : "password1234",
"status" : "enable"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
Modify root password
Modify root password
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
{"password":"admin","newpassword":"alwaysisbetterastrongpass"}
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/users/root
POST /system/users/root
Modify the root password. This user is used to access to zevenet services through GUI
Request parameters
Field | Type | Description | Required |
---|---|---|---|
password | String | Current root user password. | true |
newpassword | String | New password for root user. | true |
Response example:
{
"description" : "User settings.",
"message" : "Settings was changed succesful.",
"params" : {
"newpassword" : "alwaysisbetterastrongpass",
"password" : "admin"
}
}
Response parameters
The response will be a json with all requested values updated. See response example for more information.
List log files
List log files
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/logs
GET /system/logs
List the available log files.
Response example:
{
"description" : "Get logs",
"params" : [
{
"date" : "Mon Jan 30 06:25:02 2017",
"file" : "syslog.4.gz"
},
{
"date" : "Tue Jan 31 06:25:03 2017",
"file" : "syslog.3.gz"
},
{
"date" : "Wed Feb 1 06:25:04 2017",
"file" : "syslog.2.gz"
},
{
"date" : "Thu Feb 2 06:25:03 2017",
"file" : "syslog.1"
},
{
"date" : "Sun Jan 29 06:25:03 2017",
"file" : "syslog.5.gz"
},
{
"date" : "Fri Feb 3 04:28:56 2017",
"file" : "syslog"
}
]
}
Response parameters
The response will be a JSON with an array of log file. The parameters of each object are:
Field | Type | Description |
---|---|---|
date | String | The date of the last file modification. |
file | String | File name of log files. It is used as log unique identifier. |
Show lines of a log files
Show lines of a log files
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/logs/kern.log/lines/2
GET /system/logs/<file>/lines/<lines>
List a number of lines of a log file. The URI param file is the log file from reading. Lines is the number of lines to show from the final.
Response example:
{
"description" : "Show a log file",
"log" : [
"Aug 28 09:44:00 maq2 kernel: [258451.740173] Netfilter messages via NETLINK v0.30.\n",
"Aug 28 09:44:00 maq2 kernel: [258451.775666] ctnetlink v0.93: registering with nfnetlink.\n"
]
}
Response parameters
The response will be a JSON with an array of log file. The key is log and its value is a array with the number of lines requested.
Download a log file
Download a log files
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/logs/syslog.2.gz > log.gz
GET /system/logs/<file>
Download a log file of the avaiable log files listed while GET request.
file is the log file unique identifier.
System - Backups
With the Backup option you can save the current system configuration and download it.
In this section, you will be able to create, restore, upload and download backup files.
List backups
List backups
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/backup
GET /system/backup
Response example:
{
"description" : "Get backups",
"params" : [
{
"date" : "Fri Feb 3 06:01:04 2017",
"name" : "newbackup"
},
{
"date" : "Fri Feb 3 05:50:48 2017",
"name" : "firstConf"
}
]
}
Response parameters
The response will be a JSON with an array of backups. The parameters of each array element are:
Field | Type | Description |
---|---|---|
date | String | The date of the last modification. |
name | String | It is the file name used as unique identifier. The file extension is .tar.gz . |
Create a backup
Create a backup
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"name":"firstConf"}'
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/backup
POST /system/backup
Create a system configuration backup of the current configuration.
Request parameters
Field | Type | Description |
---|---|---|
name | String | It is the file name used as unique identifier. The file extension is .tar.gz . |
Response example:
{
"description" : "Create a backups",
"message" : "Backup firstConf was created successful.",
"params" : "firstConf"
}
Download a backup
Download a backup
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/backup/firstConf > ~/zevenetConf.tar.gz
The backup file is in TAR GZ format.
GET /system/backup/<name>
Download a system configuration backup. name is the backup unique identifier.
Upload a backup
Upload a backup
Request example:
curl -k -X PUT -H 'Content-Type: text/plain'
--data-binary @/opt/1mar.tar.gz -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/backup/newbackup
PUT /system/backup/<name>
Upload a local stored backup to Zevenet. name is the backup unique identifier which will be stored in Zevenet.
Request parameters
It is necessary to use –data-binary to upload a backup.
Response example:
{
"description" : "Upload a backup",
"message" : "Backup newbackup was created successful.",
"params" : "newbackup"
}
Delete a backup
Delete a backup
Request example:
curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/backup/firstConf
DELETE /system/backup/<name>
Delete a backup file from Zevenet system. name is the backup unique identifier.
Response example:
{
"description" : "Delete backup firstConf'",
"message" : "The list firstConf has been deleted successful.",
"success" : "true"
}
Apply a backup
Apply a backup
Request example:
curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"action":"apply"}'
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/backup/firstConf/actions
POST /system/backup/<name>/actions
Restore the configuration from a backup file. name is the backup unique identifier.
Request parameters
Field | Type | Description |
---|---|---|
action | String | To restore the backup configuration, the value must be apply. |
Response example:
{
"description" : "Apply a backup to the system",
"params" : {
"action" : "apply"
}
}
Download a supportsave
Download a supportsave
Request example:
curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v3.1/zapi.cgi/system/supportsave > supportsave.tar.gz
GET /system/supportsave
Get system status image with all configuration and process running in the system. This supportsave it is necessary to find issues or support assistance.