Module ngx_http_api_module

Example Configuration
Directives
     api
     status_zone
Compatibility
Endpoints
     /
     /nginx
     /processes
     /connections
     /slabs/
     /slabs/{slabZoneName}
     /http/
     /http/requests
     /http/server_zones/
     /http/server_zones/{httpServerZoneName}
     /http/location_zones/
     /http/location_zones/{httpLocationZoneName}
     /http/caches/
     /http/caches/{httpCacheZoneName}
     /http/limit_conns/
     /http/limit_conns/{httpLimitConnZoneName}
     /http/limit_reqs/
     /http/limit_reqs/{httpLimitReqZoneName}
     /http/upstreams/
     /http/upstreams/{httpUpstreamName}/
     /http/upstreams/{httpUpstreamName}/servers/
     /http/upstreams/{httpUpstreamName}/servers/{httpUpstreamServerId}
     /http/keyvals/
     /http/keyvals/{httpKeyvalZoneName}
     /stream/
     /stream/server_zones/
     /stream/server_zones/{streamServerZoneName}
     /stream/limit_conns/
     /stream/limit_conns/{streamLimitConnZoneName}
     /stream/upstreams/
     /stream/upstreams/{streamUpstreamName}/
     /stream/upstreams/{streamUpstreamName}/servers/
     /stream/upstreams/{streamUpstreamName}/servers/{streamUpstreamServerId}
     /stream/keyvals/
     /stream/keyvals/{streamKeyvalZoneName}
     /stream/zone_sync/
     /resolvers/
     /resolvers/{resolverZoneName}
     /ssl
Response Objects

The ngx_http_api_module module (1.13.3) provides REST API for accessing various status information, configuring upstream server groups on-the-fly, and managing key-value pairs without the need of reconfiguring nginx.

The module supersedes the ngx_http_status_module and ngx_http_upstream_conf_module modules.

When using the PATCH or POST methods, make sure that the payload does not exceed the buffer size for reading the client request body, otherwise, the 413 (Request Entity Too Large) error may be returned.

This module is available as part of our commercial subscription.

Example Configuration

http {
    upstream backend {
        zone http_backend 64k;

        server backend1.example.com weight=5;
        server backend2.example.com;
    }

    proxy_cache_path /data/nginx/cache_backend keys_zone=cache_backend:10m;

    server {
        server_name backend.example.com;

        location / {
            proxy_pass  http://backend;
            proxy_cache cache_backend;

            health_check;
        }

        status_zone server_backend;
    }

    keyval_zone zone=one:32k state=one.keyval;
    keyval $arg_text $text zone=one;

    server {
        listen 127.0.0.1;

        location /api {
            api write=on;
            allow 127.0.0.1;
            deny all;
        }
    }
}

stream {
    upstream backend {
        zone stream_backend 64k;

        server backend1.example.com:12345 weight=5;
        server backend2.example.com:12345;
    }

    server {
        listen      127.0.0.1:12345;
        proxy_pass  backend;
        status_zone server_backend;
        health_check;
    }
}

All API requests include a supported API version in the URI. Examples of API requests with this configuration:

http://127.0.0.1/api/8/
http://127.0.0.1/api/8/nginx
http://127.0.0.1/api/8/connections
http://127.0.0.1/api/8/http/requests
http://127.0.0.1/api/8/http/server_zones/server_backend
http://127.0.0.1/api/8/http/caches/cache_backend
http://127.0.0.1/api/8/http/upstreams/backend
http://127.0.0.1/api/8/http/upstreams/backend/servers/
http://127.0.0.1/api/8/http/upstreams/backend/servers/1
http://127.0.0.1/api/8/http/keyvals/one?key=arg1
http://127.0.0.1/api/8/stream/
http://127.0.0.1/api/8/stream/server_zones/server_backend
http://127.0.0.1/api/8/stream/upstreams/
http://127.0.0.1/api/8/stream/upstreams/backend
http://127.0.0.1/api/8/stream/upstreams/backend/servers/1

Directives

Syntax: api [write=on|off];
Default:
Context: location

Turns on the REST API interface in the surrounding location. Access to this location should be limited.

The write parameter determines whether the API is read-only or read-write. By default, the API is read-only.

All API requests should contain a supported API version in the URI. If the request URI equals the location prefix, the list of supported API versions is returned. The current API version is “8”.

The optional “fields” argument in the request line specifies which fields of the requested objects will be output:

http://127.0.0.1/api/8/nginx?fields=version,build

Syntax: status_zone zone;
Default:
Context: server, location, if in location

This directive appeared in version 1.13.12.

Enables collection of virtual http or stream server status information in the specified zone. Several servers may share the same zone.

Starting from 1.17.0, status information can be collected per location. The special value off disables statistics collection in nested location blocks. Note that the statistics is collected in the context of a location where processing ends. It may be different from the original location, if an internal redirect happens during request processing.

Compatibility

Endpoints

/

Supported methods:

  • GET - Return list of root endpoints

    Returns a list of root endpoints.

    Possible responses:

    • 200 - Success, returns an array of strings
    • 404 - Unknown version (UnknownVersion), returns Error
/nginx

Supported methods:

  • GET - Return status of nginx running instance

    Returns nginx version, build name, address, number of configuration reloads, IDs of master and worker processes.

    Request parameters:

    fields (string, optional)
    Limits which fields of nginx running instance will be output.

    Possible responses:

    • 200 - Success, returns nginx
    • 404 - Unknown version (UnknownVersion), returns Error
/processes

Supported methods:

  • GET - Return nginx processes status

    Returns the number of abnormally terminated and respawned child processes.

    Possible responses:

    • 200 - Success, returns Processes
    • 404 - Unknown version (UnknownVersion), returns Error
  • DELETE - Reset nginx processes statistics

    Resets counters of abnormally terminated and respawned child processes.

    Possible responses:

    • 204 - Success
    • 404 - Unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/connections

Supported methods:

  • GET - Return client connections statistics

    Returns statistics of client connections.

    Request parameters:

    fields (string, optional)
    Limits which fields of the connections statistics will be output.

    Possible responses:

    • 200 - Success, returns Connections
    • 404 - Unknown version (UnknownVersion), returns Error
  • DELETE - Reset client connections statistics

    Resets statistics of accepted and dropped client connections.

    Possible responses:

    • 204 - Success
    • 404 - Unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/slabs/

Supported methods:

  • GET - Return status of all slabs

    Returns status of slabs for each shared memory zone with slab allocator.

    Request parameters:

    fields (string, optional)
    Limits which fields of slab zones will be output. If the “fields” value is empty, then only zone names will be output.

    Possible responses:

/slabs/{slabZoneName}
Parameters common for all methods:
slabZoneName (string, required)
The name of the shared memory zone with slab allocator.

Supported methods:

  • GET - Return status of a slab

    Returns status of slabs for a particular shared memory zone with slab allocator.

    Request parameters:

    fields (string, optional)
    Limits which fields of the slab zone will be output.

    Possible responses:

  • DELETE - Reset slab statistics

    Resets the “reqs” and “fails” metrics for each memory slot.

    Possible responses:

    • 204 - Success
    • 404 - Slab not found (SlabNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/http/

Supported methods:

  • GET - Return list of HTTP-related endpoints

    Returns a list of first level HTTP endpoints.

    Possible responses:

    • 200 - Success, returns an array of strings
    • 404 - Unknown version (UnknownVersion), returns Error
/http/requests

Supported methods:

  • GET - Return HTTP requests statistics

    Returns status of client HTTP requests.

    Request parameters:

    fields (string, optional)
    Limits which fields of client HTTP requests statistics will be output.

    Possible responses:

    • 200 - Success, returns HTTP Requests
    • 404 - Unknown version (UnknownVersion), returns Error
  • DELETE - Reset HTTP requests statistics

    Resets the number of total client HTTP requests.

    Possible responses:

    • 204 - Success
    • 404 - Unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/http/server_zones/

Supported methods:

  • GET - Return status of all HTTP server zones

    Returns status information for each HTTP server zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of server zones will be output. If the “fields” value is empty, then only server zone names will be output.

    Possible responses:

    • 200 - Success, returns a collection of "HTTP Server Zone" objects for all HTTP server zones
    • 404 - Unknown version (UnknownVersion), returns Error
/http/server_zones/{httpServerZoneName}
Parameters common for all methods:
httpServerZoneName (string, required)
The name of an HTTP server zone.

Supported methods:

  • GET - Return status of an HTTP server zone

    Returns status of a particular HTTP server zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of the server zone will be output.

    Possible responses:

    • 200 - Success, returns HTTP Server Zone
    • 404 - Server zone not found (ServerZoneNotFound), unknown version (UnknownVersion), returns Error
  • DELETE - Reset statistics for an HTTP server zone

    Resets statistics of accepted and discarded requests, responses, received and sent bytes, counters of SSL handshakes and session reuses in a particular HTTP server zone.

    Possible responses:

    • 204 - Success
    • 404 - Server zone not found (ServerZoneNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/http/location_zones/

Supported methods:

  • GET - Return status of all HTTP location zones

    Returns status information for each HTTP location zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of location zones will be output. If the “fields” value is empty, then only zone names will be output.

    Possible responses:

    • 200 - Success, returns a collection of "HTTP Location Zone" objects for all HTTP location zones
    • 404 - Unknown version (UnknownVersion), returns Error
/http/location_zones/{httpLocationZoneName}
Parameters common for all methods:
httpLocationZoneName (string, required)
The name of an HTTP location zone.

Supported methods:

  • GET - Return status of an HTTP location zone

    Returns status of a particular HTTP location zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of the location zone will be output.

    Possible responses:

    • 200 - Success, returns HTTP Location Zone
    • 404 - Location zone not found (LocationZoneNotFound), unknown version (UnknownVersion), returns Error
  • DELETE - Reset statistics for a location zone.

    Resets statistics of accepted and discarded requests, responses, received and sent bytes in a particular location zone.

    Possible responses:

    • 204 - Success
    • 404 - Location zone not found (LocationZoneNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/http/caches/

Supported methods:

  • GET - Return status of all caches

    Returns status of each cache configured by proxy_cache_path and other “*_cache_path” directives.

    Request parameters:

    fields (string, optional)
    Limits which fields of cache zones will be output. If the “fields” value is empty, then only names of cache zones will be output.

    Possible responses:

    • 200 - Success, returns a collection of "HTTP Cache" objects for all HTTP caches
    • 404 - Unknown version (UnknownVersion), returns Error
/http/caches/{httpCacheZoneName}
Parameters common for all methods:
httpCacheZoneName (string, required)
The name of the cache zone.

Supported methods:

  • GET - Return status of a cache

    Returns status of a particular cache.

    Request parameters:

    fields (string, optional)
    Limits which fields of the cache zone will be output.

    Possible responses:

    • 200 - Success, returns HTTP Cache
    • 404 - Cache not found (CacheNotFound), unknown version (UnknownVersion), returns Error
  • DELETE - Reset cache statistics

    Resets statistics of cache hits/misses in a particular cache zone.

    Possible responses:

    • 204 - Success
    • 404 - Cache not found (CacheNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/http/limit_conns/

Supported methods:

  • GET - Return status of all HTTP limit_conn zones

    Returns status information for each HTTP limit_conn zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of limit_conn zones will be output. If the “fields” value is empty, then only zone names will be output.

    Possible responses:

    • 200 - Success, returns a collection of "HTTP Connections Limiting" objects for all HTTP limit conns
    • 404 - Unknown version (UnknownVersion), returns Error
/http/limit_conns/{httpLimitConnZoneName}
Parameters common for all methods:
httpLimitConnZoneName (string, required)
The name of a limit_conn zone.

Supported methods:

  • GET - Return status of an HTTP limit_conn zone

    Returns status of a particular HTTP limit_conn zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of the limit_conn zone will be output.

    Possible responses:

  • DELETE - Reset statistics for an HTTP limit_conn zone

    Resets the connection limiting statistics.

    Possible responses:

    • 204 - Success
    • 404 - limit_conn not found (LimitConnNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/http/limit_reqs/

Supported methods:

  • GET - Return status of all HTTP limit_req zones

    Returns status information for each HTTP limit_req zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of limit_req zones will be output. If the “fields” value is empty, then only zone names will be output.

    Possible responses:

/http/limit_reqs/{httpLimitReqZoneName}
Parameters common for all methods:
httpLimitReqZoneName (string, required)
The name of a limit_req zone.

Supported methods:

  • GET - Return status of an HTTP limit_req zone

    Returns status of a particular HTTP limit_req zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of the limit_req zone will be output.

    Possible responses:

  • DELETE - Reset statistics for an HTTP limit_req zone

    Resets the requests limiting statistics.

    Possible responses:

    • 204 - Success
    • 404 - limit_req not found (LimitReqNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/http/upstreams/

Supported methods:

  • GET - Return status of all HTTP upstream server groups

    Returns status of each HTTP upstream server group and its servers.

    Request parameters:

    fields (string, optional)
    Limits which fields of upstream server groups will be output. If the “fields” value is empty, only names of upstreams will be output.

    Possible responses:

    • 200 - Success, returns a collection of "HTTP Upstream" objects for all HTTP upstreams
    • 404 - Unknown version (UnknownVersion), returns Error
/http/upstreams/{httpUpstreamName}/
Parameters common for all methods:
httpUpstreamName (string, required)
The name of an HTTP upstream server group.

Supported methods:

  • GET - Return status of an HTTP upstream server group

    Returns status of a particular HTTP upstream server group and its servers.

    Request parameters:

    fields (string, optional)
    Limits which fields of the upstream server group will be output.

    Possible responses:

    • 200 - Success, returns HTTP Upstream
    • 400 - Upstream is static (UpstreamStatic), returns Error
    • 404 - Unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
  • DELETE - Reset statistics of an HTTP upstream server group

    Resets the statistics for each upstream server in an upstream server group and queue statistics.

    Possible responses:

    • 204 - Success
    • 400 - Upstream is static (UpstreamStatic), returns Error
    • 404 - Unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/http/upstreams/{httpUpstreamName}/servers/
Parameters common for all methods:
httpUpstreamName (string, required)
The name of an upstream server group.

Supported methods:

  • GET - Return configuration of all servers in an HTTP upstream server group

    Returns configuration of each server in a particular HTTP upstream server group.

    Possible responses:

    • 200 - Success, returns an array of HTTP Upstream Servers
    • 400 - Upstream is static (UpstreamStatic), returns Error
    • 404 - Unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
  • POST - Add a server to an HTTP upstream server group

    Adds a new server to an HTTP upstream server group. Server parameters are specified in the JSON format.

    Request parameters:

    postHttpUpstreamServer (HTTP Upstream Server, required)
    Address of a new server and other optional parameters in the JSON format. The “ID”, “backup”, and “service” parameters cannot be changed.

    Possible responses:

    • 201 - Created, returns HTTP Upstream Server
    • 400 - Upstream is static (UpstreamStatic), invalid “parameter” value (UpstreamConfFormatError), missing “server” argument (UpstreamConfFormatError), unknown parameter “name” (UpstreamConfFormatError), nested object or list (UpstreamConfFormatError), “error” while parsing (UpstreamBadAddress), service upstream “host” may not have port (UpstreamBadAddress), service upstream “host” requires domain name (UpstreamBadAddress), invalid “weight” (UpstreamBadWeight), invalid “max_conns” (UpstreamBadMaxConns), invalid “max_fails” (UpstreamBadMaxFails), invalid “fail_timeout” (UpstreamBadFailTimeout), invalid “slow_start” (UpstreamBadSlowStart), reading request body failed BodyReadError), route is too long (UpstreamBadRoute), “service” is empty (UpstreamBadService), no resolver defined to resolve (UpstreamConfNoResolver), upstream “name” has no backup (UpstreamNoBackup), upstream “name” memory exhausted (UpstreamOutOfMemory), returns Error
    • 404 - Unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
    • 409 - Entry exists (EntryExists), returns Error
    • 415 - JSON error (JsonError), returns Error
/http/upstreams/{httpUpstreamName}/servers/{httpUpstreamServerId}
Parameters common for all methods:
httpUpstreamName (string, required)
The name of the upstream server group.
httpUpstreamServerId (string, required)
The ID of the server.

Supported methods:

  • GET - Return configuration of a server in an HTTP upstream server group

    Returns configuration of a particular server in the HTTP upstream server group.

    Possible responses:

    • 200 - Success, returns HTTP Upstream Server
    • 400 - Upstream is static (UpstreamStatic), invalid server ID (UpstreamBadServerId), returns Error
    • 404 - Server with ID “id” does not exist (UpstreamServerNotFound), unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
  • PATCH - Modify a server in an HTTP upstream server group

    Modifies settings of a particular server in an HTTP upstream server group. Server parameters are specified in the JSON format.

    Request parameters:

    patchHttpUpstreamServer (HTTP Upstream Server, required)
    Server parameters, specified in the JSON format. The “ID”, “backup”, and “service” parameters cannot be changed.

    Possible responses:

    • 200 - Success, returns HTTP Upstream Server
    • 400 - Upstream is static (UpstreamStatic), invalid “parameter” value (UpstreamConfFormatError), unknown parameter “name” (UpstreamConfFormatError), nested object or list (UpstreamConfFormatError), “error” while parsing (UpstreamBadAddress), invalid “server” argument (UpstreamBadAddress), invalid server ID (UpstreamBadServerId), invalid “weight” (UpstreamBadWeight), invalid “max_conns” (UpstreamBadMaxConns), invalid “max_fails” (UpstreamBadMaxFails), invalid “fail_timeout” (UpstreamBadFailTimeout), invalid “slow_start” (UpstreamBadSlowStart), reading request body failed BodyReadError), route is too long (UpstreamBadRoute), “service” is empty (UpstreamBadService), server “ID” address is immutable (UpstreamServerImmutable), server “ID” weight is immutable (UpstreamServerWeightImmutable), upstream “name” memory exhausted (UpstreamOutOfMemory), returns Error
    • 404 - Server with ID “id” does not exist (UpstreamServerNotFound), unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
    • 415 - JSON error (JsonError), returns Error
  • DELETE - Remove a server from an HTTP upstream server group

    Removes a server from an HTTP upstream server group.

    Possible responses:

    • 200 - Success, returns an array of HTTP Upstream Servers
    • 400 - Upstream is static (UpstreamStatic), invalid server ID (UpstreamBadServerId), server “id” not removable (UpstreamServerImmutable), returns Error
    • 404 - Server with ID “id” does not exist (UpstreamServerNotFound), unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/http/keyvals/

Supported methods:

  • GET - Return key-value pairs from all HTTP keyval zones

    Returns key-value pairs for each HTTP keyval shared memory zone.

    Request parameters:

    fields (string, optional)
    If the “fields” value is empty, then only HTTP keyval zone names will be output.

    Possible responses:

/http/keyvals/{httpKeyvalZoneName}
Parameters common for all methods:
httpKeyvalZoneName (string, required)
The name of an HTTP keyval shared memory zone.

Supported methods:

  • GET - Return key-value pairs from an HTTP keyval zone

    Returns key-value pairs stored in a particular HTTP keyval shared memory zone.

    Request parameters:

    key (string, optional)
    Get a particular key-value pair from the HTTP keyval zone.

    Possible responses:

    • 200 - Success, returns HTTP Keyval Shared Memory Zone
    • 404 - Keyval not found (KeyvalNotFound), keyval key not found (KeyvalKeyNotFound), unknown version (UnknownVersion), returns Error
  • POST - Add a key-value pair to the HTTP keyval zone

    Adds a new key-value pair to the HTTP keyval shared memory zone. Several key-value pairs can be entered if the HTTP keyval shared memory zone is empty.

    Request parameters:

    Key-value (HTTP Keyval Shared Memory Zone, required)
    A key-value pair is specified in the JSON format. Several key-value pairs can be entered if the HTTP keyval shared memory zone is empty. Expiration time in milliseconds can be specified for a key-value pair with the expire parameter which overrides the timeout parameter of the keyval_zone directive.

    Possible responses:

    • 201 - Created
    • 400 - Invalid JSON (KeyvalFormatError), invalid key format (KeyvalFormatError), key required (KeyvalFormatError), keyval timeout is not enabled (KeyvalFormatError), only one key can be added (KeyvalFormatError), reading request body failed BodyReadError), returns Error
    • 404 - Keyval not found (KeyvalNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
    • 409 - Entry exists (EntryExists), key already exists (KeyvalKeyExists), returns Error
    • 413 - Request Entity Too Large, returns Error
    • 415 - JSON error (JsonError), returns Error
  • PATCH - Modify a key-value or delete a key

    Changes the value of the selected key in the key-value pair, deletes a key by setting the key value to null, changes expiration time of a key-value pair. If synchronization of keyval zones in a cluster is enabled, deletes a key only on a target cluster node. Expiration time in milliseconds can be specified for a key-value pair with the expire parameter which overrides the timeout parameter of the keyval_zone directive.

    Request parameters:

    httpKeyvalZoneKeyValue (HTTP Keyval Shared Memory Zone, required)
    A new value for the key is specified in the JSON format.

    Possible responses:

    • 204 - Success
    • 400 - Invalid JSON (KeyvalFormatError), key required (KeyvalFormatError), keyval timeout is not enabled (KeyvalFormatError), only one key can be updated (KeyvalFormatError), reading request body failed BodyReadError), returns Error
    • 404 - Keyval not found (KeyvalNotFound), keyval key not found (KeyvalKeyNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
    • 413 - Request Entity Too Large, returns Error
    • 415 - JSON error (JsonError), returns Error
  • DELETE - Empty the HTTP keyval zone

    Deletes all key-value pairs from the HTTP keyval shared memory zone. If synchronization of keyval zones in a cluster is enabled, empties the keyval zone only on a target cluster node.

    Possible responses:

    • 204 - Success
    • 404 - Keyval not found (KeyvalNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/stream/

Supported methods:

  • GET - Return list of stream-related endpoints

    Returns a list of first level stream endpoints.

    Possible responses:

    • 200 - Success, returns an array of strings
    • 404 - Unknown version (UnknownVersion), returns Error
/stream/server_zones/

Supported methods:

  • GET - Return status of all stream server zones

    Returns status information for each stream server zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of server zones will be output. If the “fields” value is empty, then only server zone names will be output.

    Possible responses:

    • 200 - Success, returns a collection of "Stream Server Zone" objects for all stream server zones
    • 404 - Unknown version (UnknownVersion), returns Error
/stream/server_zones/{streamServerZoneName}
Parameters common for all methods:
streamServerZoneName (string, required)
The name of a stream server zone.

Supported methods:

  • GET - Return status of a stream server zone

    Returns status of a particular stream server zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of the server zone will be output.

    Possible responses:

    • 200 - Success, returns Stream Server Zone
    • 404 - Server zone not found (ServerZoneNotFound), unknown version (UnknownVersion), returns Error
  • DELETE - Reset statistics for a stream server zone

    Resets statistics of accepted and discarded connections, sessions, received and sent bytes, counters of SSL handshakes and session reuses in a particular stream server zone.

    Possible responses:

    • 204 - Success
    • 404 - Server zone not found (ServerZoneNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/stream/limit_conns/

Supported methods:

  • GET - Return status of all stream limit_conn zones

    Returns status information for each stream limit_conn zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of limit_conn zones will be output. If the “fields” value is empty, then only zone names will be output.

    Possible responses:

/stream/limit_conns/{streamLimitConnZoneName}
Parameters common for all methods:
streamLimitConnZoneName (string, required)
The name of a limit_conn zone.

Supported methods:

  • GET - Return status of an stream limit_conn zone

    Returns status of a particular stream limit_conn zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of the limit_conn zone will be output.

    Possible responses:

  • DELETE - Reset statistics for a stream limit_conn zone

    Resets the connection limiting statistics.

    Possible responses:

    • 204 - Success
    • 404 - limit_conn not found (LimitConnNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/stream/upstreams/

Supported methods:

  • GET - Return status of all stream upstream server groups

    Returns status of each stream upstream server group and its servers.

    Request parameters:

    fields (string, optional)
    Limits which fields of upstream server groups will be output. If the “fields” value is empty, only names of upstreams will be output.

    Possible responses:

    • 200 - Success, returns a collection of "Stream Upstream" objects for all stream upstreams
    • 404 - Unknown version (UnknownVersion), returns Error
/stream/upstreams/{streamUpstreamName}/
Parameters common for all methods:
streamUpstreamName (string, required)
The name of a stream upstream server group.

Supported methods:

  • GET - Return status of a stream upstream server group

    Returns status of a particular stream upstream server group and its servers.

    Request parameters:

    fields (string, optional)
    Limits which fields of the upstream server group will be output.

    Possible responses:

    • 200 - Success, returns Stream Upstream
    • 400 - Upstream is static (UpstreamStatic), returns Error
    • 404 - Unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
  • DELETE - Reset statistics of a stream upstream server group

    Resets the statistics for each upstream server in an upstream server group.

    Possible responses:

    • 204 - Success
    • 400 - Upstream is static (UpstreamStatic), returns Error
    • 404 - Unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/stream/upstreams/{streamUpstreamName}/servers/
Parameters common for all methods:
streamUpstreamName (string, required)
The name of an upstream server group.

Supported methods:

  • GET - Return configuration of all servers in a stream upstream server group

    Returns configuration of each server in a particular stream upstream server group.

    Possible responses:

    • 200 - Success, returns an array of Stream Upstream Servers
    • 400 - Upstream is static (UpstreamStatic), returns Error
    • 404 - Unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
  • POST - Add a server to a stream upstream server group

    Adds a new server to a stream upstream server group. Server parameters are specified in the JSON format.

    Request parameters:

    postStreamUpstreamServer (Stream Upstream Server, required)
    Address of a new server and other optional parameters in the JSON format. The “ID”, “backup”, and “service” parameters cannot be changed.

    Possible responses:

    • 201 - Created, returns Stream Upstream Server
    • 400 - Upstream is static (UpstreamStatic), invalid “parameter” value (UpstreamConfFormatError), missing “server” argument (UpstreamConfFormatError), unknown parameter “name” (UpstreamConfFormatError), nested object or list (UpstreamConfFormatError), “error” while parsing (UpstreamBadAddress), no port in server “host” (UpstreamBadAddress), service upstream “host” may not have port (UpstreamBadAddress), service upstream “host” requires domain name (UpstreamBadAddress), invalid “weight” (UpstreamBadWeight), invalid “max_conns” (UpstreamBadMaxConns), invalid “max_fails” (UpstreamBadMaxFails), invalid “fail_timeout” (UpstreamBadFailTimeout), invalid “slow_start” (UpstreamBadSlowStart), “service” is empty (UpstreamBadService), no resolver defined to resolve (UpstreamConfNoResolver), upstream “name” has no backup (UpstreamNoBackup), upstream “name” memory exhausted (UpstreamOutOfMemory), reading request body failed BodyReadError), returns Error
    • 404 - Unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
    • 409 - Entry exists (EntryExists), returns Error
    • 415 - JSON error (JsonError), returns Error
/stream/upstreams/{streamUpstreamName}/servers/{streamUpstreamServerId}
Parameters common for all methods:
streamUpstreamName (string, required)
The name of the upstream server group.
streamUpstreamServerId (string, required)
The ID of the server.

Supported methods:

  • GET - Return configuration of a server in a stream upstream server group

    Returns configuration of a particular server in the stream upstream server group.

    Possible responses:

    • 200 - Success, returns Stream Upstream Server
    • 400 - Upstream is static (UpstreamStatic), invalid server ID (UpstreamBadServerId), returns Error
    • 404 - Unknown version (UnknownVersion), upstream not found (UpstreamNotFound), server with ID “id” does not exist (UpstreamServerNotFound), returns Error
  • PATCH - Modify a server in a stream upstream server group

    Modifies settings of a particular server in a stream upstream server group. Server parameters are specified in the JSON format.

    Request parameters:

    patchStreamUpstreamServer (Stream Upstream Server, required)
    Server parameters, specified in the JSON format. The “ID”, “backup”, and “service” parameters cannot be changed.

    Possible responses:

    • 200 - Success, returns Stream Upstream Server
    • 400 - Upstream is static (UpstreamStatic), invalid “parameter” value (UpstreamConfFormatError), unknown parameter “name” (UpstreamConfFormatError), nested object or list (UpstreamConfFormatError), “error” while parsing (UpstreamBadAddress), invalid “server” argument (UpstreamBadAddress), no port in server “host” (UpstreamBadAddress), invalid server ID (UpstreamBadServerId), invalid “weight” (UpstreamBadWeight), invalid “max_conns” (UpstreamBadMaxConns), invalid “max_fails” (UpstreamBadMaxFails), invalid “fail_timeout” (UpstreamBadFailTimeout), invalid “slow_start” (UpstreamBadSlowStart), reading request body failed BodyReadError), “service” is empty (UpstreamBadService), server “ID” address is immutable (UpstreamServerImmutable), server “ID” weight is immutable (UpstreamServerWeightImmutable), upstream “name” memory exhausted (UpstreamOutOfMemory), returns Error
    • 404 - Server with ID “id” does not exist (UpstreamServerNotFound), unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
    • 415 - JSON error (JsonError), returns Error
  • DELETE - Remove a server from a stream upstream server group

    Removes a server from a stream server group.

    Possible responses:

    • 200 - Success, returns an array of Stream Upstream Servers
    • 400 - Upstream is static (UpstreamStatic), invalid server ID (UpstreamBadServerId), server “id” not removable (UpstreamServerImmutable), returns Error
    • 404 - Server with ID “id” does not exist (UpstreamServerNotFound), unknown version (UnknownVersion), upstream not found (UpstreamNotFound), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/stream/keyvals/

Supported methods:

  • GET - Return key-value pairs from all stream keyval zones

    Returns key-value pairs for each stream keyval shared memory zone.

    Request parameters:

    fields (string, optional)
    If the “fields” value is empty, then only stream keyval zone names will be output.

    Possible responses:

/stream/keyvals/{streamKeyvalZoneName}
Parameters common for all methods:
streamKeyvalZoneName (string, required)
The name of a stream keyval shared memory zone.

Supported methods:

  • GET - Return key-value pairs from a stream keyval zone

    Returns key-value pairs stored in a particular stream keyval shared memory zone.

    Request parameters:

    key (string, optional)
    Get a particular key-value pair from the stream keyval zone.

    Possible responses:

    • 200 - Success, returns Stream Keyval Shared Memory Zone
    • 404 - Keyval not found (KeyvalNotFound), keyval key not found (KeyvalKeyNotFound), unknown version (UnknownVersion), returns Error
  • POST - Add a key-value pair to the stream keyval zone

    Adds a new key-value pair to the stream keyval shared memory zone. Several key-value pairs can be entered if the stream keyval shared memory zone is empty.

    Request parameters:

    Key-value (Stream Keyval Shared Memory Zone, required)
    A key-value pair is specified in the JSON format. Several key-value pairs can be entered if the stream keyval shared memory zone is empty. Expiration time in milliseconds can be specified for a key-value pair with the expire parameter which overrides the timeout parameter of the keyval_zone directive.

    Possible responses:

    • 201 - Created
    • 400 - Invalid JSON (KeyvalFormatError), invalid key format (KeyvalFormatError), key required (KeyvalFormatError), keyval timeout is not enabled (KeyvalFormatError), only one key can be added (KeyvalFormatError), reading request body failed BodyReadError), returns Error
    • 404 - Keyval not found (KeyvalNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
    • 409 - Entry exists (EntryExists), key already exists (KeyvalKeyExists), returns Error
    • 413 - Request Entity Too Large, returns Error
    • 415 - JSON error (JsonError), returns Error
  • PATCH - Modify a key-value or delete a key

    Changes the value of the selected key in the key-value pair, deletes a key by setting the key value to null, changes expiration time of a key-value pair. If synchronization of keyval zones in a cluster is enabled, deletes a key only on a target cluster node. Expiration time is specified in milliseconds with the expire parameter which overrides the timeout parameter of the keyval_zone directive.

    Request parameters:

    streamKeyvalZoneKeyValue (Stream Keyval Shared Memory Zone, required)
    A new value for the key is specified in the JSON format.

    Possible responses:

    • 204 - Success
    • 400 - Invalid JSON (KeyvalFormatError), key required (KeyvalFormatError), keyval timeout is not enabled (KeyvalFormatError), only one key can be updated (KeyvalFormatError), reading request body failed BodyReadError), returns Error
    • 404 - Keyval not found (KeyvalNotFound), keyval key not found (KeyvalKeyNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
    • 413 - Request Entity Too Large, returns Error
    • 415 - JSON error (JsonError), returns Error
  • DELETE - Empty the stream keyval zone

    Deletes all key-value pairs from the stream keyval shared memory zone. If synchronization of keyval zones in a cluster is enabled, empties the keyval zone only on a target cluster node.

    Possible responses:

    • 204 - Success
    • 404 - Keyval not found (KeyvalNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/stream/zone_sync/

Supported methods:

  • GET - Return sync status of a node

    Returns synchronization status of a cluster node.

    Possible responses:

/resolvers/

Supported methods:

  • GET - Return status for all resolver zones

    Returns status information for each resolver zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of resolvers statistics will be output.

    Possible responses:

    • 200 - Success, returns a collection of "Resolver Zone" objects for all resolvers
    • 404 - Unknown version (UnknownVersion), returns Error
/resolvers/{resolverZoneName}
Parameters common for all methods:
resolverZoneName (string, required)
The name of a resolver zone.

Supported methods:

  • GET - Return statistics of a resolver zone

    Returns statistics stored in a particular resolver zone.

    Request parameters:

    fields (string, optional)
    Limits which fields of the resolver zone will be output (requests, responses, or both).

    Possible responses:

    • 200 - Success, returns Resolver Zone
    • 404 - Resolver zone not found (ResolverZoneNotFound), unknown version (UnknownVersion), returns Error
  • DELETE - Reset statistics for a resolver zone.

    Resets statistics in a particular resolver zone.

    Possible responses:

    • 204 - Success
    • 404 - Resolver zone not found (ResolverZoneNotFound), unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error
/ssl

Supported methods:

  • GET - Return SSL statistics

    Returns SSL statistics.

    Request parameters:

    fields (string, optional)
    Limits which fields of SSL statistics will be output.

    Possible responses:

    • 200 - Success, returns SSL
    • 404 - Unknown version (UnknownVersion), returns Error
  • DELETE - Reset SSL statistics

    Resets counters of SSL handshakes and session reuses.

    Possible responses:

    • 204 - Success
    • 404 - Unknown version (UnknownVersion), returns Error
    • 405 - Method disabled (MethodDisabled), returns Error

Response Objects