NAV Navbar
Logo
shell

Zevenet API v4.0 Reference

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/v4.0/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 needs almost a parameter although this does not need any required parameter.

Certificates

Zevenet supports cetificates in PEM format to use them with 444/zapi/v4.0/zapi.cgi 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/v4.0/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/v4.0/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/v4.0/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/v4.0/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 444/zapi/v4.0/zapi.cgi server. true
division String The division of 444/zapi/v4.0/zapi.cgi organization handling the certificate. true
organization String The legal name of 444/zapi/v4.0/zapi.cgi organization. true
locality String The city where 444/zapi/v4.0/zapi.cgi organization is located. true
state String The state/region where 444/zapi/v4.0/zapi.cgi organization is located. true
country String The two-letter ISO code for the country where 444/zapi/v4.0/zapi.cgi organization is location. true
mail String An email address used to contact 444/zapi/v4.0/zapi.cgi 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/v4.0/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/v4.0/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.

Letsencrypt SSL Certificates

Zevenet supports Letsencrypt certificates generation and renew. The finally certificate is a ZEVENET PEM certificate can be used with HTTPS Farms. . If you want to learn more about how to create pem certificates, please visit the following article: GENERATE CERTIFICATES IN PEM FORMAT

Show Letsencrypt Config

Show Letsencrypt Config

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/certificates/letsencryptz/config
zcli certificate-le-config list

GET /certificates/letsencryptz/config

Show Letsencrypt Configuration.

Response example:

The response will be a JSON object with the below parameters.

{
   "description" : "Get LetsEncrypt Config",
   "params" : {
      "email" : "test_le@zevenet.com"
   }
}

Response parameters

Field Type Description
email String Email for Letsencrypt

Modify Letsencrypt Config

Modify Letsencrypt Config

Request example:

curl -k -X PUT -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"email":"test_le@zevenet.com"}'
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/certificates/letsencryptz/config
zcli certificates-le-config set -email test_le@zevenet.com

PUT /certificates/letsencryptz/config

Modify Letsencrypt Configuration.

Request parameters

Field Type Description Required
email String Email for use as a contact in Letsencrypt true

Response example:

The response will be a JSON object with the below parameters.

{
   "description" : "Modify LetsEncrypt Config",
   "message" : "The Letsencrypt Config has been updated successfully.",
   "params" : {
      "email" : "test_le@zevenet.com"
   },
   "success" : "true"
}


Response parameters

Field Type Description
email String Email for Letsencrypt

List all Letsencrypt Certificates

List all Letsencrypt Certificates

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/certificates/letsencryptz
zcli certificate-le list 

GET /certificates/letsencryptz

List all Letsencrypt certificates created.

Response example:

The response will be a JSON object with a key set to params. The value of this will be an array of letsencrypt certificate objects, each of which contains the key attributes below.

{
   "description" : "List LetsEncrypt certificates",
   "params" : [
      {
         "CN" : "*.wildcard.test.zevenet.com",
         "creation" : "May 31 05:51:49 2021 GMT",
         "domains" : [
            "*.wildcard.test.zevenet.com"
         ],
         "expiration" : "Aug 29 05:51:49 2021 GMT",
         "file" : "/usr/local/zevenet/config/letsencrypt/acme/*.wildcard.test.zevenet.com/fullchain.cer",
         "issuer" : "US,(STAGING) Let's Encrypt,(STAGING) Artificial Apricot R3",
         "status" : "valid",
         "type" : "LE Certificate",
         "wildcard" : "true"
      },
      {
         "CN" : "*.test1.wildcard.test.zevenet.io",
         "creation" : "",
         "dnstxt" : [
            {
               "domain" : "*.test1.wildcard.test.zevenet.io",
               "txt" : "QpbOLzMrJapoQmcbrA5_dr6ciwLzNF-y3z5XR5i-I2c"
            }
         ],
         "domains" : [
            "*.test1.wildcard.test.zevenet.io"
         ],
         "expiration" : "",
         "file" : null,
         "issuer" : "",
         "status" : "not issued",
         "type" : "LE Certificate",
         "wildcard" : "true"
      }

   ]
}

Response parameters

Field Type Description
params Object[ ] Certificate objects list.

Certificate Object

Field Type Description
CN String Domain common name.
creation String Creation date.
domains String[] List of domains which the certificate is vaild for.
expiration String Expiration date.
dnstxt Object[] List of DNS TXT Records for each domains to validate if the certificate is not issued yet.
file String It is the file name of the certificate, unique ID.
issuer String Certified Authority signing the certificate.
status String Status of the certificate.valid,the certificate is valid.about to expire, the certifiacte is about to expire.expired, the certificate is expired.not issued, the certificate is pendind to be issued.unknown, the certificate is not valid.
type String LE Certificate.
wildcard String true, the certificate is for wildcards domains. false, the certificate is for non wildcards domains.

dnstxt Object

Field Type Description
domain String Domain name
txt String DNS txt record LetsEncrypt must to validate. The DNS TXT record will be accesible by _acme-challenge.domain.

Let'sEncrypt SSL No Wildcard Certificates

Let'sEncrypt no wildcard certificates are certificates valid only for no wildcard domains.

Create a new Let'sEncrypt No Wildcard Certificate

Create a new Let’s Encrypt No Wildcard Certificate

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"farmname":"lefarm","domains":["test.zevenet.com"],"test":"true","wildcard":"false"}'
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/certificates/letsencryptz
zcli certificate-le create -wildcard false 

POST /certificates/letsencryptz

Create a new Let’s Encrypt wildcard certificate.

Request parameters

Field Type Description Required
farmname String Farm name which a temporal Service “Let’s Encryptz” is configured in. true if param vip is not sent.
vip String IP of the system, where a temporal Farm “Let’s Encryptz” is configured. true if param farmname is not sent.
domains String[] List of domains which the certificate is vaild for. true
wildcard String true, the certificate is for wildcards domains. false, the certificate is for non wildcards domains. true
test String true, the certificate is issued by LetsEncrypt Staging Server. false, the certificate is issued by LetsEncrypt Server and it will valid for Production environment. true

Response example:

{
   "description" : "Create Let's Encrypt certificate",
   "params" : {
      "CN" : "test.zevenet.com",
      "creation" : "May 31 11:05:30 2021 GMT",
      "domains" : [
         "test.zevenet.io"
      ],
      "expiration" : "Aug 29 11:05:30 2021 GMT",
      "file" : "/usr/local/zevenet/config/letsencrypt/live/test.zevenet.com/fullchain.pem",
      "issuer" : "US,(STAGING) Let's Encrypt,(STAGING) Artificial Apricot R3",
      "status" : "valid",
      "type" : "LE Certificate",
      "wildcard" : "false"
   }
}

Response parameters

Field Type Description
params Object[ ] Certificate objects list.

Certificate Object

Field Type Description
CN String Domain common name.
creation String Creation date.
domains String[] List of domains which the certificate is vaild for.
expiration String Expiration date.
file String It is the file name of the certificate, unique ID.
issuer String Certified Authority signing the certificate.
status String Status of the certificate.valid,the certificate is valid.about to expire, the certifiacte is about to expire.expired, the certificate is expired.not issued, the certificate is pendind to be issued.unknown, the certificate is not valid.
type String LE Certificate.
wildcard String true, the certificate is for wildcards domains. false, the certificate is for non wildcards domains.

Set an action in a Let’s Encrypt no Wildcard Certificate

Set an action in a Let’s Encrypt No Wildcard Certificate

Request example:

curl -k -X POST -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"action":"renew","vip":"192.168.101.44","force_renewal":"true","restart":"true"}'
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/certificates/letsencryptz/example.domain.com/actions
zcli certificate-le renew example.domain.com ( not implemented )

POST /certificates/letsencryptz/<domain>/actions

Set an action in a Let’s Encrypt no wildcard certificate, see the Request parameters table for actions.

Request parameters

Field Type Description Required
action String The action to execute: the possibilities are: renew, the certificatewill be renewed.
farmname String Farm name which a temporal Service “Let’s Encryptz” is configured in to renew the certificate. true if param vip is not sent.
vip String IP of the system, where a temporal Farm “Let’s Encryptz” is configuredi to renew the certificate. true if param farmname is not sent.
force_renewal String true, force the certificate to be renewed even it is not expired, false, the certificate will be renewed if it is due to be renewed ( less than 30 days to expire ).
restart String true, all the farms using the certificate will be restarted. false, no farms using the certificate will be restarted.

Response example:

{
   "description" : "Let's Encrypt certificate actions",
   "params" : {
      "CN" : "test.zevenet.com",
      "creation" : "May 31 11:35:08 2021 GMT",
      "domains" : [
         "test.zevenet.com"
      ],
      "expiration" : "Aug 29 11:35:08 2021 GMT",
      "file" : "/usr/local/zevenet/config/letsencrypt/live/test.zevenet.com/fullchain.pem",
      "issuer" : "US,(STAGING) Let's Encrypt,(STAGING) Artificial Apricot R3",
      "status" : "valid",
      "type" : "LE Certificate",
      "wildcard" : "false"
   },
   "warning" : "The following farms were been restarted: testl7farm"
}

Response parameters

If the are farms were been restarted, the warning field will describe it.

Field Type Description
params Object[ ] Certificate objects list.

Certificate Object

Field Type Description
CN String Domain common name.
creation String Creation date.
domains String[] List of domains which the certificate is vaild for.
expiration String Expiration date.
file String It is the file name of the certificate, unique ID.
issuer String Certified Authority signing the certificate.
status String Status of the certificate.valid,the certificate is valid.about to expire, the certifiacte is about to expire.expired, the certificate is expired.not issued, the certificate is pendind to be issued.unknown, the certificate is not valid.
type String LE Certificate.
wildcard String true, the certificate is for wildcards domains. false, the certificate is for non wildcards domains.

Delete a no wildcard Let’s Encrypt Certificate

Delete a no wildcard Let’s Encrypt Certificate

Request example:

curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/certificates/letsencryptz/example.domain.com
zcli certificate-le delete example.domain.com

DELETE /certificates/letsencryptz/<domain>

Delete a Let’s Encrypt certificate by domain.

Response example:

{
   "description" : "Delete Let's Encrypt certificate",
   "message" : "Let's Encrypt Certificate example.domain.com has been deleted.",
   "success" : "true"
}

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.

List all farms

List all farms

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/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/v4.0/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/v4.0/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/v4.0/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
         }
      ],
      "addheader" : [
         {
            "header" : "load-balancer: true",
            "id" : 0
         }
      ],
      "addresponseheader" : [
         {
            "header" : "Session: true",
            "id" : 0
         }
      ],
      "headremove" : [
         {
            "id" : 0,
            "pattern" : "^client"
         }
      ],
      "removeresponseheader" : [
         {
            "id" : 0,
            "pattern" : "Host"
         }
      ],
      "ignore_100_continue" : "true",
      "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" : [],
         "farmguardian" : "check_tcp",
         "httpsb" : "false",
         "id" : "service3",
         "leastresp" : "false",
         "redirect" : "http://192.168.101.254/index.html",
         "redirecttype" : "default",
         "sessionid" : "",
         "ttl" : 0,
         "urlp" : "",
         "vhost" : "",
         "pinnedconnection" : 0,
         "routingpolicy" : "ROUND_ROBIN"
      },
      {
         "backends" : [
            {
               "id" : 0,
               "ip" : "192.168.0.168",
               "port" : 80,
               "status" : "up",
               "timeout" : null,
               "weight" : null
            }
         ],
         "farmguardian" : null,
         "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, accepted 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.

logs | String | The farm Logs the trace of the HTTP connections. If this parameter has the value true, the logs are enabled; if it has the value false, logs are disabled. ignore_100_continue | String | If this field has the value true the 100 continue HTTP header will be ignored; if the value is false, the 100 continue header will be processed (from version 4.0.2). addheader | Object[] | It is a list of objects with the headers to add to the client request (from version 4.0.2). addresponseheader | Object[] | It is a list of objects with the headers to add to the backend response (from version 4.0.2). headremove | Object[] | It is a list of regular expressions to remove headers from the client requests. The removed headers will not reach the backend (from version 4.0.2). removeresponseheader | Object[] | It is a list of regular expressions to remove headers from the backend response. The removed headers will not reach the client (from version 4.0.2). pinnedconnection (from version 4.0.2) | Number | Specify if we want to pin all the connections, (default: 0, no pinned). If Pinnedconnection is set to 1, zproxy directly forwards all data without parsing or editing. routingpolicy (from version 4.0.2) | String | Specify the routing policy. All the algorithms are weighted with all the weights set in each backend. There is four options: ROUND_ROBIN use the round robin algorithm as a routing policy (default). LEAST_CONNECTIONS select the backend with least connections established using as a proportion the weights set. RESPONSE_TIME select the backend with the lowest response time using as a proportion the weights set. PENDING_CONNECTIONS select the backend with least pending connections using as a proportion the weights set. rewriteurl (from version 4.0.2) | Object[] | It checks a pattern in order to get strings from URL and replace them. Several RewriteUrl directives can be added. All of them will be sequentially applied to the incoming URL unless the last flag is set that will finish the rewrite url phase.

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.
farmguardian String It is the FarmGuardian name that is checking the backend status. FarmGuardian will be running while the farm is in up status.
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. The possible values are from 1 to 9.
connection_limit (from 4.0.2) Number (Only when proxy new generation is working) The maximum number of established connection per backend. With a value of 0, there will not be a limit in the backend. The client will receive a 503 error if there aren’t available backends.

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/v4.0/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,
"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://<zevenet_server>:444/zapi/v4.0/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, accepted 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/v4.0/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"
}

Add a Custom Header to the Request

Add a Custom Header to the Request

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"header":"loadbalancer: true"}' https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/addheader
zcli farm-add-request-header MyHttpFarm -header "loadbalancer: true"

This call is available from version 4.0.2

POST /farms/<farmname>/addheader

The farm will add the header to the backend.

Request parameters

Field Type Description Required
header String It is a string with the header that will be sent to the backend. true

Response example:

{
   "description" : "Add addheader directive.",
   "message" : "Added a new item to the addheader list",
   "status" : "needed restart",
   "success" : "true"
}

Modify an add a Custom Header to the Request rule

Modify an add a Custom Header to the Request rule

Request example:

curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"header":"loadbalancer: true"}' https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/addheader/id
zcli farm-add-request-header MyHttpFarm -header "loadbalancer: true"

This call is available from version 4.0.2

PUT /farms/<farmname>/addheader/<id>

The farm will add the header to the backend.

Request parameters

Field Type Description Required
header String It is a string with the header that will be sent to the backend. true

Response example:

{
   "description" : "Modify an addheader directive.",
   "message" : "Modified an item from the addheader list",
   "success" : "true"
}

Delete a Custom Header from the Request

Delete a Custom Header from the Request

Request example:

curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/addheader/0
zcli farm-add-request-header remove MyHttpFarm 0

This call is available from version 4.0.2

DELETE /farms/<farmname>/addheader/<index>

index is the index of the addheader array to delete.

Response example:

{
   "description" : "Delete addheader directive.",
   "message" : "The addheader 0 was deleted successfully",
   "status" : "needed restart",
   "success" : "true"
}

Add Rule to Remove Headers from the Request

Add Rule to Remove Headers from the Request

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"pattern":"^client:"}' https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/headremove
zcli farm-remove-request-header add MyHttpFarm -pattern "^client:"

This call is available from version 4.0.2

POST /farms/<farmname>/headremove

Remove certain headers from the incoming requests. All occurrences of the matching specified header will be removed.

Request parameters

Field Type Description Required
pattern String It is a string with a regexp to look for in the client requests. If some header matches in the pattern, the header will be removed true

Response example:

{
   "description" : "Add headremove directive.",
   "message" : "Added a new item to the headremove list",
   "status" : "needed restart",
   "success" : "true"
}

Modify a Remove Headers from the Request rule

Modify a Remove Headers from the Request rule

Request example:

curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"pattern":"^client:"}' https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/headremove/id
zcli farm-remove-request-header add MyHttpFarm -pattern "^client:"

This call is available from version 4.0.2

PUT /farms/<farmname>/headremove/<id>

Remove certain headers from the incoming requests. All occurrences of the matching specified header will be removed.

Request parameters

Field Type Description Required
pattern String It is a string with a regexp to look for in the client requests. If some header matches in the pattern, the header will be removed true

Response example:

{
   "description" : "Modify an headremove directive.",
   "message" : "Modified an item from the headremove list",
   "success" : "true"
}

Delete a Rule to Remove Headers from the Request

Delete a Rule to Remove Headers from the Request

Request example:

curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/headremove/0
zcli farm-remove-request-header remove MyHttpFarm 0

This call is available from version 4.0.2

DELETE /farms/<farmname>/headremove/<index>

index is the index of the headremove array to delete.

Response example:

{
   "description" : "Delete headremove directive.",
   "message" : "The headremove 0 was deleted successfully",
   "status" : "needed restart",
   "success" : "true"
}

Add a Custom Header to the Response

Add a Custom Header to the Response

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"header":"loadbalancer: true"}' https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/addresponseheader
zcli farm-add-response-header add MyHttpFarm -header loadbalancer:true

This call is available from version 4.0.2

POST /farms/<farmname>/addresponseheader

The farm will add the header to the backend response.

Request parameters

Field Type Description Required
header String It is a string with the header that will be sent to the backend. true

Response example:

{
   "description" : "Add a header to the backend repsonse.",
   "message" : "Added a new header to the backend response",
   "status" : "needed restart",
   "success" : "true"
}

Modify an add a Custom Header to the Response rule

Modify an add a Custom Header to the Response rule

Request example:

curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"header":"loadbalancer: true"}' https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/addresponseheader/id
zcli farm-add-response-header add MyHttpFarm -header loadbalancer:true

This call is available from version 4.0.2

PUT /farms/<farmname>/addresponseheader/<id>

The farm will add the header to the backend response.

Request parameters

Field Type Description Required
header String It is a string with the header that will be sent to the backend. true

Response example:

{
   "description" : "Modify an addresponseheader directive.",
   "message" : "Modified an item from the addresponseheader list",
   "success" : "true"
}

Delete a Custom Header from the Response

Delete a Custom Header from the Response

Request example:

curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/addresponseheader/0
zcli farm-add-response-header remove torta 0

This call is available from version 4.0.2

DELETE /farms/<farmname>/addresponseheader/<index>

index is the index of the addresponseheader array to delete.

Response example:

{
   "description" : "Delete a header previously added to the backend response.",
   "message" : "The header 0 was deleted successfully",
   "status" : "needed restart",
   "success" : "true"
}

Add a Rule to Remove Headers from Response

Add a Rule to Remove Headers from Response

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"pattern":"^client:"}' https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/removeresponseheader
zcli farm-remove-response-header add MyHttpFarm -pattern "^client:"

This call is available from version 4.0.2

POST /farms/<farmname>/removeresponseheader

Remove certain headers from the incoming requests. All occurrences of the matching specified header will be removed.

Request parameters

Field Type Description Required
pattern String It is a string with a regexp to look for in the client requests. If some header matches in the pattern, the header will be removed true

Response example:

{
   "description" : "Remove a header from the backend response.",
   "message" : "Added a patter to remove reponse headers",
   "status" : "needed restart",
   "success" : "true"
}

Modify a Remove Headers from Response rule

Modify a Remove Headers from Response rule

Request example:

curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"pattern":"^client:"}' https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/removeresponseheader/id
zcli farm-remove-response-header add MyHttpFarm -pattern "^client:"

This call is available from version 4.0.2

PUT /farms/<farmname>/removeresponseheader/<id>

Remove certain headers from the incoming requests. All occurrences of the matching specified header will be removed.

Request parameters

Field Type Description Required
pattern String It is a string with a regexp to look for in the client requests. If some header matches in the pattern, the header will be removed true

Response example:

{
   "description" : "Modify a remove response header directive.",
   "message" : "Modified an item from the removeresponseheader list",
   "success" : "true"
}

Delete a Rule to Remove Header from Response

Delete a Rule to Remove Header from Response

Request example:

curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/removeresponseheader/0
zcli farm-remove-response-header remove torta 0

This call is available from version 4.0.2

DELETE /farms/<farmname>/removeresponseheader/<index>

index is the index of the removeresponseheader array to delete.

Response example:

{
   "description" : "Delete a pattern to remove response headers.",
   "message" : "The pattern 0 was deleted successfully",
   "status" : "needed restart",
   "success" : "true"
}

Add a Rule to Rewrite Headers from Request

Add a Rule to Rewrite Headers from Request

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"header":"^Cookie:","match":"^COOKIESESSION=(.*)","replace":"COOKIEUSER=$1"}'
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/replacerequestheader
farm-replace-request-header add farm1 -header ^Cookie: -match ^COOKIESESSION=(.*) -replace COOKIEUSER=$1`

This call is available from version 4.0.2

POST /farms/<farmname>/replacerequestheader

Add rules to rewrite headers from the request.

Request parameters

Field Type Description Required
header String Regex with the header name to be rewrited true
match String Regex value to match what we want to replace true
replace String Value to replace matches true

Response example:

{
   "description" : "Add a Replace Header.",
   "message" : "Added a new replace header",
   "status" : "needed restart",
   "success" : "true"
}

Modify a Rewrite Headers from Request rule

Modify a Rewrite Headers from Request rule

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"header":"^Cookie:","match":"^COOKIESESSION=(.*)","replace":"COOKIEUSER=$1"}'
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/replacerequestheader/id
farm-replace-request-header add farm1 -header ^Cookie: -match ^COOKIESESSION=(.*) -replace COOKIEUSER=$1`

This call is available from version 4.0.2

PUT /farms/<farmname>/replacerequestheader/<id>

Add rules to rewrite headers from the request.

Request parameters

Field Type Description Required
header String Regex with the header name to be rewrited true
match String Regex value to match what we want to replace true
replace String Value to replace matches true

Response example:

{
   "description" : "Modify a replaceHeader directive.",
   "message" : "Modified an item from the replaceHeader list",
   "success" : "true"
}

Delete a Rule to Rewrite Headers from Request

Delete a Rule to Rewrite Headers from Request

Request example:

curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/replacerequestheader/0
zcli farm-replace-request-header remove MyHttpFarm 0

This call is available from version 4.0.2

DELETE /farms/<farmname>/replacerequestheader/<index>

index is the index of the replacerequestheader array to delete.

Response example:

{
   "description" : "Delete a replace header directive.",
   "message" : "The replace header 0 was deleted successfully",
   "status" : "needed restart",
   "success" : "true"
}

Move a Rewrite Headers from Request rule

Move a Rewrite Headers from Request rule

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"position":1}'
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/replacerequestheader/id/actions
farm-replace-request-header add farm1 -header ^Cookie: -match ^COOKIESESSION=(.*) -replace COOKIEUSER=$1`

This call is available from version 4.0.2

POST /farms/<farmname>/replacerequestheader/<id>/actions

Move a ReplaceRequest Header.

Request parameters

Field Type Description Required
position Number New rule position true

Response example:

{
   "description" : "Move a replace header directive",
   "message" : "Header was moved successfully.",
   "params" : {
      "position" : "1"
   }
}

Add a Rule to Rewrite Headers from Response

Add a Rule to Rewrite Headers from Response

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"header":"^Cookie:","match":"^COOKIESESSION=(.*)","replace":"COOKIEUSER=$1"}'
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/replaceresponseheader
farm-replace-response-header add farm1 -header ^Cookie: -match ^COOKIESESSION=(.*) -replace COOKIEUSER=$1` -t$

This call is available from version 4.0.2

POST /farms/<farmname>/replaceresponseheader

Add rules to rewrite headers from the response.

Request parameters

Field Type Description Required
header String Regex with the header name to be rewrited true
match String Regex value to match what we want to replace true
replace String Value to replace matches true

Response example:

{
   "description" : "Add a Replace Header.",
   "message" : "Added a new replace header",
   "status" : "needed restart",
   "success" : "true"
}

Modify a Rewrite Headers from Response rule

Modify a Rewrite Headers from Response rule

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"header":"^Cookie:","match":"^COOKIESESSION=(.*)","replace":"COOKIEUSER=$1"}'
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/replaceresponseheader/id
farm-replace-response-header add farm1 -header ^Cookie: -match ^COOKIESESSION=(.*) -replace COOKIEUSER=$1` -t$

This call is available from version 4.0.2

PUT /farms/<farmname>/replaceresponseheader/<id>

Add rules to rewrite headers from the response.

Request parameters

Field Type Description Required
header String Regex with the header name to be rewrited true
match String Regex value to match what we want to replace true
replace String Value to replace matches true

Response example:

{
   "description" : "Modify a replaceHeader directive.",
   "message" : "Modified an item from the replaceHeader list",
   "success" : "true"
}

Delete a Rule to Rewrite Headers from Response

Delete a Rule to Rewrite Headers from Response

Request example:

curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/replaceresponseheader/0
zcli farm-replace-response-header remove MyHttpFarm 0

This call is available from version 4.0.2

DELETE /farms/<farmname>/replaceresponseheader/<index>

index is the index of the replaceresponseheader array to delete.

Response example:

{
   "description" : "Delete a replace header directive.",
   "message" : "The replace header 0 was deleted successfully",
   "status" : "needed restart",
   "success" : "true"
}

Move a Rewrite Headers from Request rule

Move a Rewrite Headers from Response rule

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"position":1}'
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/MyHttpFarm/replaceresponseheader/id/actions
farm-replace-response-header add farm1 -header ^Cookie: -match ^COOKIESESSION=(.*) -replace COOKIEUSER=$1`

This call is available from version 4.0.2

POST /farms/<farmname>/replaceresponseheader/<id>/actions

Move a ReplaceRequest Header.

Request parameters

Field Type Description Required
position Number New rule position true

Response example:

{
   "description" : "Move a replace header directive",
   "message" : "Header was moved successfully.",
   "params" : {
      "position" : "1"
   }
}

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.

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/v4.0/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,
            "connection_limit" : null
         },
         {
            "id" : 0,
            "ip" : "192.168.100.254",
            "port" : 80,
            "status" : "up",
            "timeout" : null,
            "weight" : null,
            "connection_limit" : null
         }
      ],
      "farmguardian" : "check_tcp-cut_conns",
      "httpsb" : "false",
      "id" : "serv",
      "leastresp" : "false",
      "persistence" : "COOKIE",
      "redirect" : "",
      "redirecttype" : "",
      "sessionid" : "JSESSIONID",
      "ttl" : 18,
      "urlp" : "(?i)^/music$",
      "vhost" : "",
      "pinnedconnection" : 0,
      "routingpolicy" : "ROUND_ROBIN",
   }
}

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.
farmguardian String It is the FarmGuardian name that is checking the backend status. FarmGuardian will be running while the farm is in up status.
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.
pinnedconnection (from version 4.0.2) Number Specify if we want to pin all the connections, (default: 0, no pinned). If Pinnedconnection is set to 1, zproxy directly forwards all data without parsing or editing.
routingpolicy (from version 4.0.2) String Specify the routing policy. All the algorithms are weighted with all the weights set in each backend. There is four options: ROUND_ROBIN use the round robin algorithm as a routing policy (default). LEAST_CONNECTIONS select the backend with least connections established using as a proportion the weights set. RESPONSE_TIME select the backend with the lowest response time using as a proportion the weights set. PENDING_CONNECTIONS select the backend with least pending connections using as a proportion the weights set.

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. The possible values are from 1 to 9.
connection_limit (from 4.0.2) Number (Only when proxy new generation is working) The maximum number of established connection per backend. With a value of 0, there will not be a limit in the backend. The client will receive a 503 error if there aren’t available backends.

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://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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.
pinnedconnection (from version 4.0.2) Number Specify if we want to pin all the connections, (default: 0, no pinned). If Pinnedconnection is set to 1, zproxy directly forwards all data without parsing or editing.
routingpolicy (from version 4.0.2) String Specify the routing policy. All the algorithms are weighted with all the weights set in each backend. There is four options: ROUND_ROBIN use the round robin algorithm as a routing policy (default). LEAST_CONNECTIONS select the backend with least connections established using as a proportion the weights set. RESPONSE_TIME select the backend with the lowest response time using as a proportion the weights set. PENDING_CONNECTIONS select the backend with least pending connections using as a proportion the weights set.

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" : [],
      "httpsb" : "true",
      "id" : "newsrv",
      "leastresp" : "true",
      "persistence" : "",
      "redirect" : "http://zenloadbalancer.com",
      "redirecttype" : "default",
      "sessionid" : "sid",
      "ttl" : 125,
      "urlp" : "^/myapp1$",
      "vhost" : "www.mywebserver.com",
      "pinnedconnection" : 0,
      "routingpolicy" : "ROUND_ROBIN",
   },
   "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.

Add FarmGuardian

Add FarmGuardian

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"name":"check_tcp-cut_conns"}' https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/FarmHTTP/services/service1/fg

POST /farms/<farmname>/services/<id>/fg

Apply a FarmGuardian to a service.

The URI parameter is the service unique identifier.

Request parameters

Field Type Description
name String FarmGuardian unique identifier. The FarmGuardians are created and modified in the monitoring section.

Response example:

{
   "description" : "Add the farm guardian check_tcp-cut_conns to the service service1 in the farm FarmHTTP",
   "message" : "Success, The farm guardian check_tcp-cut_conns was added to the service service1 in the farm FarmHTTP"
}

Remove FarmGuardian

Remove FarmGuardian

Request example:

curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/FarmHTTP/service/service1/fg/check_tcp-cut_conns

DELETE /farms/<farmname>/services/<id>/fg/<name>

Remove the FarmGuardian from a service in a farm.

Response example:

{
   "description" : "Remove the farm guardian check_tcp-cut_conns from the service service1 in the farm FarmHTTP",
   "message" : "Sucess, check_tcp-cut_conns was removed from the service service1 in the farm FarmHTTP"
}

Delete a Service

Delete a Service

Request example:

curl -k -X DELETE -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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,
         "connection_limit" : null
      },
      {
         "id" : 1,
         "ip" : "192.168.102.245",
         "port" : 80,
         "status" : "up",
         "timeout" : 22,
         "weight" : 2,
         "connection_limit" : null
      }
   ]
}

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. The possible values are from 1 to 9.
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.
connection_limit (from 4.0.2) Number (Only when proxy new generation is working) The maximum number of established connection per backend. With a value of 0, there will not be a limit in the backend. The client will receive a 503 error if there aren’t available backends.

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://<zevenet_server>:444/zapi/v4.0/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. The possible values are from 1 to 9.

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,
      "connection_limit" : null
   },
   "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://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/FarmHTTP/service/service1/backends/1

PUT /farms/<farmname>/services/<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. The possible values are from 1 to 9.

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,
      "connection_limit" : null
   },
   "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://<zevenet_server>:444/zapi/v4.0/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.
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://<zevenet_server>:444/zapi/v4.0/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/v4.0/zapi.cgi/farms/l4farm

GET /farms/<farmname>

Show all configuration about a given farm.

Response BODY:

{
   "backends" : [
      {
         "id" : 0,
         "ip" : "192.168.55.40",
         "priority" : 2,
         "status" : "undefined",
         "weight" : 1
      },
      {
         "id" : 1,
         "ip" : "192.168.55.41",
         "priority" : 3,
         "status" : "undefined",
         "weight" : 2
      }
   ],
   "description" : "List farm l4farm",
   "params" : {
      "algorithm" : "weight",
      "farmguardian" : "check_tcp",
      "listener" : "l4xnat",
      "nattype" : "nat",
      "protocol" : "tcp",
      "status" : "down",
      "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: weight connection linear dispatching by weight, Source Hash Hash per Source IP and Source Port, Simple Source Hash Hash per Source IP only, Symmetric Hash Round trip hash per IP and Port.
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, dsr Direct server return, the load balancer change the destination mac and the response goes directly to the client.
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 will only balance TCP L4 protocol, udp the load balancer will only balance UDP L4 protocol, sip the load balancer will only balance SIP or VoIP L7 protocol, ftp the load balancer will only balance FTP L7 protocol, tftp the load balancer will only balance TFTP L7 protocol, sctp the load balancer will only balance SCTP L4 protocol, amanda the load balancer will only balance AMANDA L7 protocol, h323 the load balancer will only balance H323 L7 protocol, irc the load balancer will only balance IRC L7 protocol, netbios-ns the load balancer will only balance NETBIOS-NS 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.
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 ,.
farmguardian String It is the FarmGuardian name that is checking the backend status. FarmGuardian will be running while the farm is in up status.

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.
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 and 9 is the least priority.
weight Number It’s the weight value for the current real server. Backends with more weight will receive more connections. The possible values are from 1 to 9.

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/v4.0/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","newfarmname":"l4farm", "protocol":"tcp",
"nattype":"nat","vip":"178.62.126.152","vport":"81"}'
https://<zevenet_server>:444/zapi/v4.0/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: weight connection linear dispatching by weight, Source Hash Hash per Source IP and Source Port, Simple Source Hash Hash per Source IP only, Symmetric Hash Round trip hash per IP and Port.
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, dsr Direct server return, the load balancer change the destination mac and the response goes directly to the client.
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 will only balance TCP L4 protocol, udp the load balancer will only balance UDP L4 protocol, sip the load balancer will only balance SIP or VoIP L7 protocol, ftp the load balancer will only balance FTP L7 protocol, tftp the load balancer will only balance TFTP L7 protocol, sctp the load balancer will only balance SCTP L4 protocol, amanda the load balancer will only balance AMANDA L7 protocol, h323 the load balancer will only balance H323 L7 protocol, irc the load balancer will only balance IRC L7 protocol, netbios-ns the load balancer will only balance NETBIOS-NS protocol, pptp the load balancer will only balance H323 L7 protocol.
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",
      "protocol" : "tcp",
      "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.

Add FarmGuardian

Add FarmGuardian

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"name":"check_tcp-cut_conns"}' https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/l4Farm/fg

POST /farms/<farmname>/fg

Apply a FarmGuardian to the farm.

Request parameters

Field Type Description
name String FarmGuardian unique identifier. The FarmGuardians are created and modified in the monitoring section.

Response example:

{
   "description" : "Add the farm guardian check_tcp-cut_conns to the farm fgl4",
   "message" : "Success, The farm guardian check_tcp-cut_conns was added to the farm fgl4"
}

Remove FarmGuardian

Remove FarmGuardian

Request example:

curl -k -X DELETE -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/farms/l4Farm/fg/check_tcp-cut_conns

DELETE /farms/<farmname>/fg/<name>

Remove the FarmGuardian from the farm.

Response example:

{
   "description" : "Remove the farm guardian check_tcp-cut_conns from the farm fgl4",
   "message" : "Sucess, check_tcp-cut_conns was removed from the farm fgl4"
}

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://<zevenet_server>:444/zapi/v4.0/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",
         "priority" : 1,
         "status" : "up",
         "weight" : 1
      },
      {
         "id" : 1,
         "ip" : "192.5.1.3",
         "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.
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 and 9 is the least priority.
weight Number It’s the weight value for the current real server. Backends with more weight will receive more connections. The possible values are from 1 to 9.

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"}'
https://<zevenet_server>:444/zapi/v4.0/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
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 and 9 is the least priority.
weight Number It’s the weight value for the current real server. Backends with more weight will receive more connections. The possible values are from 1 to 9.

Response example:

{
   "description" : "New farm backend",
   "message" : "Backend added",
   "params" : {
      "id" : 5,
      "ip" : "192.168.5.100",
      "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","priority":4,"weight":7}'
  https://<zevenet_server>:444/zapi/v4.0/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.
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 and 9 is the least priority.
weight Number It’s the weight value for the current real server. Backends with more weight will receive more connections. The possible values are from 1 to 9.

Response example:

{
   "description" : "Modify backend",
   "message" : "Backend modified",
   "params" : {
      "ip" : "192.168.5.40",
      "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://<zevenet_server>:444/zapi/v4.0/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
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.
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.

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://<zevenet_server>:444/zapi/v4.0/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"
}

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://<zevenet_server>:444/zapi/v4.0/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 true, the interface it is parent of a VLAN interface; or false, the interface has not got any VLAN interface appending of it. 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/v4.0/zapi.cgi/interfaces/gateway/ipv4

GET /interfaces/gateway/<ip_version>

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.

The system has configured two gateways, once to route IPv4 and another to route IPv6. The URI expects a IP version ipv4 or ipv6.

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://<zevenet_server>:444/zapi/v4.0/zapi.cgi/interfaces/gateway/ipv4

PUT /interfaces/gateway/<ip_version>

Modify the configuration of the gateway interface.

The URI expects the IP version used in the address field. The possible values are ipv4 and ipv6.

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/<ip_version>

Delete the configuration of the default gateway configuration.

The URI expects one IP version of the default gateway to delete. The possible values are ipv4 and ipv6.

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://<zevenet_server>:444/zapi/v4.0/zapi.cgi/interfaces/gateway/ipv4

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://<zevenet_server>:444/zapi/v4.0/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 true, the interface it is parent of a VLAN interface; or false, the interface has not got any VLAN interface appending of it.
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://<zevenet_server>:444/zapi/v4.0/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.
type String The different kind of interfaces are: nic, vlan or virtual. Each one are defined in their network submenu.

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://<zevenet_server>:444/zapi/v4.0/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.
force String If a farm is using the interface, the interface won’t be able to be modified. Then, if this parameter is sent with the value true, the interface will be forced to take the new configuration and all farms are using the interface will be restarted.

Response example:

{
   "description" : "Configure nic interface",
   "params" : {
      "gateway" : "192.168.100.5",
      "ip" : "192.168.100.102",
      "netmask" : "255.255.255.0",
      "force" : "true"
   }
}

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://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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.
force String If a farm is using the interface, the interface won’t be able to be modified. Then, if this parameter is sent with the value true, the interface will be forced to take the new configuration and all farms are using the interface will be restarted.

Response example:

{
   "description" : "Modify VLAN interface",
   "params" : {
      "gateway" : "192.168.131.1",
      "ip" : "192.168.131.155",
      "netmask" : "255.255.255.0",
      "force" : "true",
   }
}

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://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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.
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.

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://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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 required
ip String IP of the interface. The IP must be in same network segment than parent interface. true
force String If a farm is using the interface, the interface won’t be able to be modified. Then, if this parameter is sent with the value true, the interface will be forced to take the new configuration and all farms are using the interface will be restarted.

Response example:

{
   "description" : "Modify virtual interface",
   "params" : {
      "ip" : "192.168.100.10",
      "force" : "true"
   }
}

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://<zevenet_server>:444/zapi/v4.0/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://<zevenet_server>:444/zapi/v4.0/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 - FarmGuardian

FarmGuardian is used for advanced monitoring state of backends. When a problem is detected by FarmGuardian automatically disables the real server and will be marked as blacklisted.

List FarmGuardians

List FarmGuardians

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/monitoring/fg

GET /monitoring/fg

List the FarmGuardians. Templates and availabe FarmGuardians appear in the list.

Response example:

{
   "description" : "List farm guardian checks and templates",
   "params" : [
      {
         "command" : "check_tcp -p PORT -H HOST",
         "cut_conns" : "false",
         "description" : "It does a TCP connection to test if the backend is alive",
         "farms" : [],
         "interval" : 5,
         "log" : "false",
         "name" : "check_tcp-cut_conns",
         "template" : "true"
      },
      {
         "command" : "check_tcp -p 80 -H HOST",
         "cut_conns" : "false",
         "description" : "TCP check to the port 80",
         "farms" : [
                     "web_service",
                     "my_welcome_web"
         ],
         "interval" : 7,
         "log" : "true",
         "name" : "custom-tcp",
         "template" : "false"
      },
      {
         "command" : "check_tcp -p PORT -H HOST",
         "cut_conns" : "false",
         "description" : "It does a TCP connection to test if the backend is alive",
         "farms" : [],
         "interval" : 5,
         "log" : "false",
         "name" : "check_tcp",
         "template" : "true"
      }
   ]
}

Response parameters

The response will be a JSON object with the key params and the format below:

Field Type Description
command String Command to check the service status in the backend. Those available commands are in libexec path.
cut_conns String The possible values are: true, FarmGuardian cuts the current connections when the backend is not available; or false, if the backend it is not available, it will be disabled but the alive sessions continue.
description String Tiny description about the check.
farms String[] Farms where the FarmGuardian is applied.
interval Number Time between checks.
log String The possible values are: true, FarmGuardian will log each check; or false, if the backend it is not available, it will be disabled but the alive sessions continue.
name String Unique identifier.
template String If the FarmGuardian is a template, it won’t be applied to any farm. The templates are useful to create a new FarmGuardian.

Retrieve a FarmGuardian

Retrieve a FarmGuardian

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/monitoring/fg/check_tcp

GET /monitoring/fg/<name>

Show the configuration of a FarmGuardian.

The URI parameter name is the FarmGuardian unique identifier.

Response example:

{
   "description" : "Retrive the farm guardian check_tcp",
   "params" : {
      "command" : "check_tcp -p PORT -H HOST",
      "cut_conns" : "false",
      "description" : "It does a TCP connection to test if the backend is alive",
      "farms" : [],
      "interval" : 5,
      "log" : "false",
      "name" : "check_tcp",
      "template" : "true"
   }
}

Response parameters

The response will be a JSON object with the key params and the format below:

Field Type Description
command String Command to check the service status in the backend. Those available commands are in libexec path.
cut_conns String The possible values are: true, FarmGuardian cuts the current connections when the backend is not available; or false, if the backend it is not available, it will be disabled but the alive sessions continue.
description String Tiny description about the check.
farms String[] Farms where the FarmGuardian is applied.
interval Number Time between checks.
log String The possible values are: true, FarmGuardian will log each check; or false, if the backend it is not available, it will be disabled but the alive sessions continue.
name String Unique identifier.
template String If the FarmGuardian is a template, it won’t be modified. The templates are useful to create a new FarmGuardian or apply directly to farms.

Create a FarmGuardian

Create a FarmGuardian

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"name":"check_tcp-cut_conns", "parent":"check_tcp"}'
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/monitoring/fg

POST /monitoring/fg

Create a new FarmGuardian.

Request parameters

The response will be a JSON object with the key params and the format below:

Field Type Description Required
name String Unique identifier. true
parent String It is the FarmGuardian used as template to create the new FarmGuardian. If this field is not sent, the new FarmGuardian is created in blank.

Response example:

{
   "description" : "Create a farm guardian check_tcp-cut_conns",
   "message" : "The farm guardian check_tcp-cut_conns has been created successfully",
   "params" : {
      "command" : "check_tcp -p PORT -H HOST",
      "cut_conns" : "false",
      "description" : "It does a TCP connection to test if the backend is alive",
      "farms" : [],
      "interval" : 5,
      "log" : "false",
      "name" : "check_tcp-cut_conns",
      "template" : "true"
   }
}

Response parameters

The response will be a JSON object with the key params and the format below:

Field Type Description
command String Command to check the service status in the backend. Those available commands are in libexec path.
cut_conns String The possible values are: true, FarmGuardian cuts the current connections when the backend is not available; or false, if the backend it is not available, it will be disabled but the alive sessions continue.
description String Tiny description about the check.
farms String[] Farms where the FarmGuardian is applied.
interval Number Time between checks.
log String The possible values are: true, FarmGuardian will log each check; or false, if the backend it is not available, it will be disabled but the alive sessions continue.
name String Unique identifier.
template String If the FarmGuardian is a template, it won’t be modified. The templates are useful to create a new FarmGuardian or apply directly to farms.

Modify a FarmGuardian

Modify a FarmGuardian

Request example:

curl -k -X PUT -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"interval":7,"log":"true","description":"TCP check to the port 80","command":"check_tcp -p 80 -H HOST","cut_conns":"false"}'
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/monitoring/fg/custom-tcp

PUT /monitoring/fg/<name>

Modify a FarmGuardian.

The URI parameter name is the FarmGuardian unique identifier.

Request parameters

The response will be a JSON object with the key params and the format below:

Field Type Description Required
command String Command to check the service status in the backend. Those available commands are in libexec path.
cut_conns String The possible values are: true, FarmGuardian cuts the current connections when the backend is not available; or false, if the backend it is not available, it will be disabled but the alive sessions continue.
description String Tiny description about the check.
interval Number Time between checks.
log String The possible values are: true, FarmGuardian will log each check; or false, if the backend it is not available, it will be disabled but the alive sessions continue.
force String If a running farm is using the FarmGuardian, FarmGuardian won’t be able to be modified. Then, if this parameter is sent with the value true, the FarmGuardian will be forced to take the new configuration.

Response example:

{
   "description" : "Modify farm guardian custom-tcp",
   "message" : "Success, some parameters have been changed in farm guardian custom-tcp.",
   "params" : {
      "command" : "check_tcp -p 80 -H HOST",
      "cut_conns" : "false",
      "description" : "TCP check to the port 80",
      "farms" : [],
      "interval" : 7,
      "log" : "true",
      "name" : "custom-tcp",
      "template" : "false"
   }
}

Response parameters

The response will be a JSON object with the key params and the format below:

Field Type Description
command String Command to check the service status in the backend. Those available commands are in libexec path.
cut_conns String The possible values are: true, FarmGuardian cuts the current connections when the backend is not available; or false, if the backend it is not available, it will be disabled but the alive sessions continue.
description String Tiny description about the check.
farms String[] Farms where the FarmGuardian is applied.
interval Number Time between checks.
log String The possible values are: true, FarmGuardian will log each check; or false, if the backend it is not available, it will be disabled but the alive sessions continue.
name String Unique identifier.
template String If the FarmGuardian is a template, it won’t be applied to any farm. The templates are useful to create a new FarmGuardian.

Delete a FarmGuardian

Delete a FarmGuardian

Request example:

curl -k -X DELETE -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/monitoring/fg/custom-tcp

DELETE /monitoring/fg/<name>

DELETE a FarmGuardian.

The URI parameter name is the FarmGuardian unique identifier.

Response example:

{
   "description" : "Delete the farm guardian custom-tcp",
   "message" : "custom-tcp has been deleted successful.",
   "success" : "true"
}

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/v4.0/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.2 in in" : 0,
         "eth0.2 out out" : 0,
         "eth1 in in" : 234.72,
         "eth1 out out" : 0,
         "eth2 in in" : 234.72,
         "eth2 out out" : 0,
         "eth3 in in" : 0,
         "eth3 out out" : 0,
         "eth4 in in" : 436.89,
         "eth4 out out" : 4300.38,
         "eth4.6 in in" : 0,
         "eth4.6 out out" : 0,
         "eth5 in in" : 301.39,
         "eth5 out out" : 0,
         "eth5.5 in in" : 0,
         "eth5.5 out out" : 0,
         "eth6 in in" : 77.42,
         "eth6 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/v4.0/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" : "77.42",
            "interface" : "eth6",
            "out" : "0.00"
         },
         {
            "in" : "2703.88",
            "interface" : "eth0",
            "out" : "50917.65"
         }
      ]
   }
}

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 interfaces statistics

Show interfaces statistics

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/stats/system/network/interfaces

GET /stats/system/network/interfaces

Get a summary of each network interface.

Response example:

{
   "description" : "Interfaces info",
   "params" : {
      "nic" : [
         {
            "in" : "77.42",
            "interface" : "eth6",
            "ip" : "",
            "mac" : "ea:00:7d:88:1d:bd",
            "out" : "0.00",
            "status" : "up",
            "virtual" : [],
            "vlan" : []
         },
         {
            "in" : "2704.81",
            "interface" : "eth0",
            "ip" : "192.168.101.46",
            "mac" : "9e:2e:3e:a5:2e:6a",
            "out" : "51039.13",
            "status" : "up",
            "virtual" : [
               "eth0:1",
               "eth0:2",
               "eth0.2:6"
            ],
            "vlan" : [
               "eth0.2"
            ]
         },
         {
            "in" : "234.72",
            "interface" : "eth1",
            "ip" : "192.168.101.58",
            "mac" : "c2:d0:d7:64:df:68",
            "out" : "0.00",
            "status" : "up",
            "virtual" : [],
            "vlan" : []
         },
         {
            "in" : "234.72",
            "interface" : "eth2",
            "ip" : "",
            "mac" : "3a:3a:a7:e3:33:73",
            "out" : "0.00",
            "status" : "up",
            "virtual" : [],
            "vlan" : []
         },
         {
            "in" : "0.00",
            "interface" : "eth3",
            "ip" : "192.168.101.72",
            "mac" : "16:97:ab:43:87:02",
            "out" : "0.00",
            "status" : "down",
            "virtual" : [
               "eth3:1",
               "eth3:8",
               "eth3:6"
            ],
            "vlan" : []
         },
         {
            "in" : "436.89",
            "interface" : "eth4",
            "ip" : "",
            "mac" : "ea:00:7d:88:1d:bd",
            "out" : "4300.38",
            "status" : "up",
            "virtual" : [
               "eth4.6:5"
            ],
            "vlan" : [
               "eth4.6"
            ]
         },
         {
            "in" : "301.39",
            "interface" : "eth5",
            "ip" : "",
            "mac" : "ea:00:7d:88:1d:bd",
            "out" : "0.00",
            "status" : "up",
            "virtual" : [],
            "vlan" : [
               "eth5.5"
            ]
         }
      ]
   }
}

Response parameters

The response will be a JSON with a key params whose value is an object with the key nic.

Field Type Description
nic Object[] NIC interface statistics.

Nic object:

Field Type Description
in String Total input traffic in MB.
interface String Interface name used as unique identifier.
ip String Interface’s IP.
mac String Interface’s MAC.
out String Total output traffic in MB.
status String Interface status. The value can be down, the interface is disabled; up, the interface is enabled.
virtual String [] Virtual interfaces that inherit from this interface.
vlan String [] VLAN interfaces that inherit from this interface.

Show memory statistics

Show memory statistics

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/stats/system/memory

GET /stats/system/memory

Get a summary of the system memory.

Response example:

{
   "description" : "Memory usage",
   "params" : {
      "Buffers" : 1.01,
      "Cached" : 42.47,
      "MemFree" : 880.11,
      "MemTotal" : 2005.01,
      "MemUsed" : 1124.91,
      "SwapCached" : 8.27,
      "SwapFree" : 565.15,
      "SwapTotal" : 672,
      "SwapUsed" : 106.84,
      "date" : "Fri Jan 27 12:27:11 2017",
      "hostname" : "api3"
   }
}

Response parameters

The response will be a JSON with a key params whose value is a memory object.

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.
date String System date.
hostname String Host’s name.

Show load statistics

Show load statistics

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/stats/system/load

GET /stats/system/load

Get a summary of the CPU system load.

Response example:

{
   "description" : "System load",
   "params" : {
      "Last_1" : 0.66,
      "Last_15" : 0.39,
      "Last_5" : 0.49,
      "date" : "Fri Jan 27 13:15:01 2017",
      "hostname" : "api3"
   }
}

Response parameters

Field Type Description
Last_1 Number Load system usage the last.
Last_5 Number Load system usage the last five minutes.
Last_15 Number Load system usage the last fiveteen minutes.
date String System date.
hostname String Host’s name.

Show CPU statistics

Show CPU statistics

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/stats/system/cpu

GET /stats/system/cpu

Response example:

{
   "description" : "System CPU usage",
   "params" : {
      "cores" : 2,
      "date" : "Fri Jan 27 13:30:52 2017",
      "hostname" : "api3",
      "idle" : 94.9,
      "iowait" : 0,
      "irq" : 0,
      "nice" : 0,
      "softirq" : 0,
      "sys" : 3.06,
      "usage" : 5.1,
      "user" : 2.04
   }
}

Response parameters

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.
date String System date.
hostname String Host’s name.

Show connections statistics

Show connections statistics

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/stats/system/connections

GET /stats/system/connections

Get the total current connections in the system. The counter sums any type of tracked connections: ASSURED, ESTABLISHED, SYN_SENT, TIME_WAIT, LISTEN…

Response example:

{
   "description" : "System connections",
   "params" : {
      "connections" : 324
   }
}

Response parameters

Field Type Description
connections Number Total tracked connections actually.

Show number of farms

Show number of farms

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/stats/farms/total

GET /stats/farms/total

Show the total of farms created in the system.

Response example:

{
   "description" : "Number of farms.",
   "number" : 8
}

Response parameters

Field Type Description
number Number It is the number of farms existing in the system.

Show farms statistics

Show farms statistics

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/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/v4.0/zapi.cgi/stats/farms/farmname

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" : 1,
         "id" : 5,
         "ip" : "192.168.5.100",
         "pending" : 0,
         "port" : "8080",
         "status" : "up"
      }
   ],
   "description" : "List farm stats",
   "sessions" : [
      {
         "id" : 5,
         "session" : "192.168.5.100"
      }
   ]

}

Response parameters in L4xNAT farms

The response will be a JSON with object backends and sessions:

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.

Session object:

Field Type Description
id Number Backend unique identifier where the client is assigned.
session String Session unique identifier. It is the client IP.

Datalink farms statistics is not available actually.

Show module status

Show module status

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/stats/farms/modules

GET /stats/farms/modules

Get a summary of modules statistics. This call shows each module status, number of configured, the number of farms put down and up.

The definition about modules is in Farms section.

Response example:

{
   "description" : "Module status",
   "params" : {
      "dslb" : {
         "critical" : 0,
         "down" : 1,
         "problem" : 0,
         "total" : 2,
         "up" : 1
      },
      "lslb" : {
         "critical" : 0,
         "down" : 2,
         "problem" : 0,
         "total" : 4,
         "up" : 2
      }
   }
}

Response parameters

The response will be a JSON with three keys: dslb and lslb.

Field Type Description
critical Number Number of farms in critical status. The farm is critical when it is up and all backends are unreachable (down or maintenance).
down Number Number of stopped farms. The farms are stopped by system administrator.
problem Number Number of farms in problem status. The farm is problem when it is up and almost a backend is in down status.
total Number Number of total farms.
up Number Number of running farms. Here is displayed maintenanced and need to restart farm status.

Show module statistics

Show module statistics

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/stats/farms/modules/lslb

GET /stats/farms/modules/<module>

Show farms statistics of a specified module.

The available values for the module parameter are: lslb or dslb.

Response example:

{
   "description" : "List lslb farms stats",
   "farms" : [
      {
         "established" : 0,
         "farmname" : "newfarm",
         "pending" : 0,
         "profile" : "http",
         "status" : "up",
         "vip" : "192.168.100.199",
         "vport" : "40"
      },
      {
         "established" : 0,
         "farmname" : "nwl4farm",
         "pending" : 0,
         "profile" : "l4xnat",
         "status" : "down",
         "vip" : "192.168.100.241",
         "vport" : "88"
      },
      {
         "established" : 0,
         "farmname" : "l4farm",
         "pending" : 0,
         "profile" : "l4xnat",
         "status" : "up",
         "vip" : "192.168.100.102",
         "vport" : "70"
      }
   ]
}

Response parameters

The response will be a JSON object with information about farms in the module.

Field Type Description
established Number Total number of current established connections.
farmname String Farm name, unique identifier for farms.
pending Number Number of pending connections.
profile String Type of farm. The possible values are: datalink, l4xnat, http or https. Each profile is defined themself 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.

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/v4.0/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",
      "eth2",
      "eth1",
      "eth3",
      "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/v4.0/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/v4.0/zapi.cgi/graphs/interfaces/eth3

Request example for a disk:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/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/v4.0/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/v4.0/zapi.cgi/graphs/interfaces/eth3/monthly

Request example for a disk:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/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/v4.0/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 version.

Show DNS

Show DNS

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/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/v4.0/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/v4.0/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/v4.0/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/v4.0/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/v4.0/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/v4.0/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.

Download a supportsave

Download a supportsave

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/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.

Retrieve the current user

Retrieve the current user

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/system/users

GET /system/users

Show information about the current user. The current user is the user get from the ZAPI_KEY or the user logged by the webgui

Response example:

{
   "description" : "Retrieve the user root",
   "params" : {
      "user" : "root",
      "zapi_permissions" : "true"
   }
}

Response parameters

The response will be a JSON object with an array of the below parameters.

Field Type Description
user String It is the user owner of the ZAPI_KEY. It can be the root default user.
zapi_permissions String If the value is true, the user can use the Zevenet api using the user’s zapikey; or if the value is false, the user has disabled the to use the zapi.

Modify the current user

Modify the current user

Request example:

curl -k -X POST -H 'Content-Type: application/json' -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
-d '{"password":"CDe0c3ck","newpassword":"v2mfcvv2","zapi_permissions":"false","zapikey":"vCeH60mQFf2MgH5"}'

https://<zevenet_server>:444/zapi/v4.0/zapi.cgi/system/users

POST /system/users

Modify the configuration of the current user. The current user is the user get from the ZAPI_KEY or the user logged by the webgui.

Request parameters:

Field Type Description Required
zapikey String Each user can have a zapikey. With this zapikey the user can do action through the zapikey with the permissions of the user’s role.
zapi_permissions String The possible values are: true, to enable the access to the load balancer through the zapi; or false, to not allow the access through the zapi.
newpassword String New user password to access through the web gui.
password String Current user password. It is required when newpassword is sent.

Response example:

{
   "description" : "Modify the user Shadi",
   "message" : "Settings was changed successful."
}

List log files

List log files

Request example:

curl -k -X GET -H "ZAPI_KEY: <ZAPI_KEY_STRING>"
https://<zevenet_server>:444/zapi/v4.0/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/v4.0/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/v4.0/zapi.cgi/system/logs/syslog.2.gz > log.gz

GET /system/logs/<file>

Download a log file of the available 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/v4.0/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/v4.0/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/v4.0/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/v4.0/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/v4.0/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/v4.0/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"
   }
}