WebtoB Admin API

WebtoB provides management features through the Admin API using Rest API. A port can be specified in the /server/admin settings, and API communication is performed through that port.

The admin settings in config are configured as follows. In the following example settings, Admin API communication is possible on port 9090.

"server":{
    "admin": {
        "port": 9090
    }
}

The following describes the APIs provided by the Admin API.

API Description

/config

Displays environment configuration settings.

/updateconfig

Reloads the config file to dynamically apply settings.

/cliinfo

Checks the connected web browser.

/connectioninfo

Displays connection information.

/svginfo

Checks server group information.

/statinfo

Retrieves statistics about the state of processes, threads, and services.

/restat

Resets statistics for the server process.

/shutdown

Shuts down WebtoB.

/cachelist

Displays information about responses stored in the HTTP response cache.

/cacherefresh

Deletes responses stored in the HTTP response cache.

 

The main features of WebtoB Admin API are as follows:

  • All APIs communicate using the POST method.

  • For APIs operating on HTH, if there is no response from HTH for a certain period of time, it will be displayed as 'busy_hth' after a timeout. For example, if HTH-1 and HTH-2 do not respond within the timeout period for the /cliinfo API, the information will be displayed as 'busy_hth' as shown in the following example.

    {
        "result": {
            "HTH-0": [
                {
                    ...
                }
            ]
        },
        "busy_hth": [
            "HTH-1",
            "HTH-2"
        ]
    }
  • If the API operates correctly, it returns HTTP response code 200, otherwise it returns an appropriate response code depending on the situation.

    The following describes common error response codes.

    Response Code Description

    400

    Failed to validate JSON schema for HTTP body.

    401

    User authentication failed.

    403

    No permission to perform actions on the requested API.

    404

    Requested API not found.

    405

    Invalid method used for the request.

    500

    An error occurred during API operation. (The specific error and message differ depending on the API)

  • If the response code is not 200, it is commonly structured as follows:

    {
        "error_code": string,
        "error_message": string
    }

    For example, a response code of 404 may appear as follows:

    {
        "error_code": "APIERR_COMMON_0003",
        "error_message": "No such API"
    }

Environment Information

/config

Retrieves the environment information of the currently running system. This process allows you to check not only the values specified in the environment settings file but also the values applied by default.

  • Usage

    {
        "path": string
    }
    Option Description

    Path

    Specifies the JSON path to the environment configuration file. The path must always start with '/'.
    If the path is omitted or set to '/', all currently configured settings will be retrieved.

  • Example

    The following is an example of checking the NODE section environment settings with the "/config" Admin API. For detailed information of the configuration items in the NODE section, refer to Configuration Items.

    [Request]
    {
        "path": "/node"
    }
    
    [Response]
    {
        "result": {
            "cache_entry": 128,
            "cache_key": "HOST_URI",
            "cache_max_file_size": 8192,
            "connection_pool_size": 8192,
            "graceful_shutdown_timeout": 5,
            "hth_count": 1,
            "hth_schedule": "RR",
            "limit_request_body_size": 0,
            "limit_request_header_field_count": 100,
            "limit_request_header_field_size": 8190,
            "limit_request_line_size": 8190,
            "listen_backlog": 4096,
            "max_cache_memory_size": 100,
            "name": "webtob-server",
            "system_filters": [],
            "worker_threads": 1
        }
    }

/updateconfig

Reloads the config file to dynamically apply the settings. However, only the settings specified with the '|dynamic|' key in the schema file will be applied.

  • Usage

    This API does not require any separate parameters.

  • Example

    The following is an example of updating the settings with the "/updateconfig" Admin API after modifying the config file.

    [Request]
    { }
    
    [Response]
    { }

Action State Information

/cliinfo

Displays the environment settings, such as the current status, IP address, number of processed requests, of the currently connected client (usually a web browser).

  • Usage

    {
        "http_server": string,
        "virtual_host": string,
        "hth_number": integer
    }
    Option Description

    None

    Retrieves information about all clients connected to the server.

    http_server

    Retrieves information about clients connected to the specified HTTP server.

    virtual_host

    Retrieves information about the clients connected to the specified virtual host. This option can only be set if http_server is set, and the value must be a virtual host name included in the http_server.

    hth_number

    Retrieves information about clients connected to the specified HTH. If not specified, information for all HTHs will be retrieved.

  • Example

    The following is an example of checking the client information connected to the vhost1 virtual host in HTH 3 using the "/cliinfo" Admin API.

    [Request]
    {
        "http_server": "http1",
        "virtual_host": "vhost1",
        "hth_number": 3
    }
    
    [Response]
    {
        "result": {
            "HTH-3": [
                {
                    "no": 1,
                    "idle": 24,
                    "local_ipaddr:port": "192.168.15.167:8080",
                    "remote_ipaddr:port": "192.168.15.168:48006",
                    "request_count": 0,
                    "response_count": 0,
                    "ssl": false,
                    "status": "READY",
                    "http_server": "http1",
                    "virtual_host": "vhost1"
                },
                {
                    "no": 0,
                    "idle": 24,
                    "local_ipaddr:port": "192.168.15.167:8080",
                    "remote_ipaddr:port": "192.168.15.168:48005",
                    "request_count": 2,
                    "response_count": 2,
                    "ssl": false,
                    "status": "READY",
                    "http_server": "http1",
                    "virtual_host": "vhost1"
                }
            ]
        }
    }

    The following describes each output item.

    Item Description

    no

    The connection number managed internally by WebtoB.

    idle

    Client idle time with no data exchanges.

    local_ipaddr:port,
    remote_ipaddr:port

    IP address and port number of the server and client.

    request_count

    The number of requests sent by the client.

    response_count

    The number of responses sent to the client.

    ssl

    Specifies whether the client is using an SSL connection.

    status

    Client state within the server.

    • CONNECTING: Trying to connect.

    • CONNECTED: Connection established.

    • READY: Receiving requests from the client.

    • RUNNING: A client request is being processed on the server.

    • DISCONNECTING: Attempting to terminate the connection.

    • DISCONNECTED: Connection terminated.

    http_server

    The HTTP server that the client connected to.

    virtual_host

    The last virtual host accessed by the client.

/connectioninfo

Displays the environment settings, such as the current status, IP address, number of processed requests, of the currently connected client (usually a web browser) and server.

  • Usage

    {
        "hth_number": integer
    }
    Option Description

    None

    Retrieves information about all clients connected to WebtoB.

    hth_number

    Retrieves information about clients and servers connected to the specified HTH. If not specified, information for all HTHs is retrieved.

  • Example

    The following is an example of checking the client and server information connected to HTH 3 using the "/connectioninfo" Admin API.

    [Request]
    {
        "hth_number": 3
    }
    
    [Response]
    {
        "result": {
            "HTH-3": [
                {
                    "acceptor": "WJP-0",
                    "request_count": 1,
                    "response_count": 1,
                    "counterpart": "",
                    "idle": 3,
                    "local_ipaddr:port": "127.0.0.1:9999",
                    "no": 0,
                    "remote_ipaddr:port": "127.0.0.1:44866",
                    "remote_type": "JSV",
                    "ssl": false,
                    "status": "READY",
                    "virtual_host": ""
                },
                {
                    "acceptor": "http1",
                    "request_count": 2,
                    "response_count": 2,
                    "counterpart": "",
                    "idle": 2,
                    "local_ipaddr:port": "192.168.15.167:8080",
                    "no": 10,
                    "remote_ipaddr:port": "192.168.15.168:64223",
                    "remote_type": "CLIENT",
                    "ssl": false,
                    "status": "READY",
                    "virtual_host": ""
                },
                {
                    "acceptor": "",
                    "request_count": 1,
                    "response_count": 1,
                    "counterpart": "",
                    "idle": 2,
                    "local_ipaddr:port": "192.168.15.167:60504",
                    "no": 11,
                    "remote_ipaddr:port": "192.168.15.124:8080",
                    "remote_type": "RPROXY",
                    "ssl": false,
                    "status": "READY",
                    "virtual_host": ""
                }
            ]
        }
    }

    The following describes each output item.

    Item Description

    no

    The connection number managed internally by WebtoB.

    idle

    Idle time with no data exchanges.

    local_ipaddr:port,
    remote_ipaddr:port

    IP address and port number of the server and client.

    request_count

    The number of requests sent through this connection.

    response_count

    The number of responses sent through this connection.

    ssl

    Specifies whether the connection is established using SSL.

    status

    Client state within the server.

    • CONNECTING: Trying to connect.

    • CONNECTED: Connection established.

    • READY: Receiving requests from the client.

    • RUNNING: A client request is being processed on the server.

    • DISCONNECTING: Attempting to terminate the connection.

    • DISCONNECTED: Connection terminated.

    acceptor

    The server that this connection is connected to.

    virtual_host

    The last virtual host accessed by this connection. (Applies only to clients)

    counterpart

    The number of the counterpart to this connection. If the current connection is a client, the counterpart refers to a server connection, and vice versa. For queued WJP connection, it may be displayed as -1.

/svginfo

Displays information about each server group that is currently running.

  • Usage

    {
        "jeus" : array(string),
        "rproxy" : array(string)
    }
    Option Description

    None

    Displays information about all server groups.

    jeus

    Specifies the JEUS server group name. Including "*" displays information for all server groups.

    rproxy

    Specifies the reverse proxy group name. Including "*" displays information for all server groups.

  • Example

    The following is an example of checking information for all JEUS server groups and the reverse proxy group named rproxy1 using the "/svginfo" Admin API.

    [Request]
    {
        "jeus" : [*],
        "rproxy" : ["rproxy1"]
    }
    
    [Response]
    "result": [
        {
            "HTH-0": {
                "jeus": [
                    {
                        "aqcnt": 0,
                        "count": 0,
                        "cqcnt": 0,
                        "qpcnt": 0,
                        "reqs": 0,
                        "rscnt": 0,
                        "status": "NRDY",
                        "svgname": "MyGroup2"
                    },
                    {
                        "aqcnt": 0,
                        "count": 0,
                        "cqcnt": 0,
                        "qpcnt": 0,
                        "reqs": 0,
                        "rscnt": 0,
                        "status": "NRDY",
                        "svgname": "MyGroup1"
                    }
                ],
                "rproxy": [
                    {
                        "aqcnt": 0,
                        "count": 0,
                        "cqcnt": 0,
                        "qpcnt": 0,
                        "reqs": 0,
                        "rscnt": 0,
                        "status": "RDY",
                        "svgname": "rproxy1"
                    }
                ]
            }
        }
    ]

    The following describes each output item.

    Item Description

    aqcnt

    Cumulative number of queued requests. (Cumulative cqcnt value)

    count

    Number of processed requests.

    cqcnt

    Number of requests in the queue.

    qpcnt

    Number of queued requests that have been removed from the queue due to request timeout, qp command, etc.

    reqs

    Number of requests sent to the server.

    rscnt

    Number of server restarts due to abnormal termination.

    status

    Client state within the server.

    • RDY: Request can be processed. There are server processes connected to WebtoB.

    • NRDY: Request cannot be processed. There are no server processes connected to WebtoB.

    • BLK: Server is suspended by administrator command. Request cannot be processed.

    svgname

    Server group name specified in configuration.

/statinfo

Displays statistics on the running processes and services of the currently running server.

You can check dynamic information such as the number of services processed by each server and the number of connections.

  • Usage

    {
        "hth_number" : integer,
        "target":{
            "jeus": array(string),
            "rproxy" : array(string),
            "htmls": boolean
        }
    }
    Option Description

    hth_number

    Specifies the HTH number for which to check statistics.

    target/jeus

    Specifies the JSV server for which to display statistical information. If "*" is included, information for all JSV servers is displayed.

    target/rproxy

    Specifies the reverse proxy server for which to display server status. If '*' is included, information for all reverse proxy servers is displayed.

    target/htmls

    Specifies whether to display HTMLS statistical information.

    At least one item must be specified under 'target'.

  • Example

    The following is an example of checking information for the JEUS server called MyGroup1, the server in the reverse proxy group called rproxy1, and the HTMLS server using the "/statinfo" Admin API.

    [Request]
    {
        "hth_number" : 1,
        "target":{
            "jeus": ["MyGroup1"],
            "rproxy" : ["rproxy1"],
            "htmls": true
        }
    }
    
    [Response]
    {
        "result": {
            "HTH-0": {
                "jeus": [
                    {
                        "average_processed_time": 0.0,
                        "connections": 50,
                        "request_count": 0,
                        "response_count": 0,
                        "server": "amV1c19kb21haW4vc2VydmVyMQ==",
                        "server_group": "MyGroup1",
                        "sticky_routed_count": 0
                    }
                ],
                "rproxy": [
                    {
                        "average_processed_time": 0.0,
                        "connections": 0,
                        "request_count": 0,
                        "response_count": 0,
                        "server": "192.168.15.167:8090",
                        "server_group": "rproxy1",
                        "sticky_routed_count": 0
                    },
                    {
                        "average_processed_time": 0.0,
                        "connections": 0,
                        "request_count": 0,
                        "response_count": 0,
                        "server": "192.168.15.167:8088",
                        "server_group": "rproxy1",
                        "sticky_routed_count": 0
                    }
                ],
                "htmls": {
                    "average_processed_time": 0.000309519,
                    "queue_count": 0,
                    "request_count": 5,
                    "response_count": 5,
                    "server": "HTMLS"
                }
            }
        }
    }

    The following describes each output item.

    Item Description

    average_processed_time

    The average processing time per request. (Unit: seconds)

    connections

    The number of connections linked to the server.

    request_count

    The number of requests sent to the process.

    response_count

    The number of requests processed by the process.

    server

    The name of a server belonging to the server group.

    • jeus: jengineid

    • Reverse proxy: Target server address

    • HTMLS: HTMLS (fixed)

    server_group

    The server group name

    sticky_routed_count

    The number of times the request was routed to the server based on the Sticky ID received from the client.

/restat

Initializes statistics of server processes. Use this command to reset a specific service or server process statistical information.

  • Usage

    {
       "hth_number" : integer,
       "target":{
           "jeus": array(string),
           "rproxy" : array(string),
           "htmls": boolean
       }
    }
    Option Description

    None

    Initializes all HTHs.

    hth_number

    Specifies the HTH number to initialize. If not set, all HTHs are initialized.

    target

    Specifies the target to initialize. At least one target must be set.

    target/jeus

    Specifies the JEUS server to initialize. If '*' is included, all JEUS servers are initialized.

    target/rproxy

    Specifies the reverse proxy servers to initialize. If '*' is included, all reverse proxy servers are initialized.

    target/htmls

    Specifies whether to initialize HTMLS statistics.

  • Example

    The following is an example of initializing statistics of a JEUS server named "MyGroup1".

    [Request]
    {
       "target": {
           "jeus": ["MyGroup1"]
       }
    }
    
    [Response]
    "HTH-0": {
       "jeus": [
           "MyGroup1"
       ]
    }

    Returns the names of the targets that were successfully initialized for each HTH.

Process Shutdown

/shutdown

Shuts down the running WebtoB.

  • Usage

    {
       "timeout": integer
    }
    Option Description

    "timeout"

    Specifies the timeout for the graceful shutdown process in seconds. If WebtoB does not shut down within the specified time, it will be forcibly terminated.
    If omitted, the value set in /node/graceful_shutdown_timeout is applied.

  • Example

    The following is an example of calling the "/shutdown" Admin API to forcibly terminate WebtoB if it hasn’t shut down after attempting a graceful shutdown for 30 seconds.

    [Request]
    {
       "timeout": 30
    }
    
    [Response]
    {
       "result": {}
    }

    The response is returned immediately after WebtoB receives the command. However, the WebtoB process may still be running even after the response is received.

Cache Information Management

/cachelist

Displays the response information currently stored in WebtoB’s HTTP response cache.

  • Usage

    {
        "hth_number": integer
    }
    Option Description

    None

    Displays all cache information.

    "hth_number"

    Specifies the HTH number to query cache information.

  • Example

    The following is an example of checking cache information for HTH 0 using the "/cachelist" Admin API. The rest of the request path is used only for internal server debugging.

    [Request]
    {
        "hth_number": 0
    }
    
    
    [Response]
    "result": {
        "HTH-0": {
            "cache_map": [
                {
                    "expire_time": "2023-10-25 16:35:18",
                    "key": "192.168.15.167:8080/index.html",
                    "size": 4312
                },
                {
                    "expire_time": "2023-10-25 16:34:52",
                    "key": "192.168.15.167:8080/favicon.ico",
                    "size": 4507
                },
                {
                    "expire_time": "2023-10-25 16:34:52",
                    "key": "192.168.15.167:8080/4.html",
                    "size": 219
                }
            ],
            "cache_map_size": 3,
            "memory_usage": 9038
        }
    }

    The following describes each output item.

    Item Description

    cache_map

    Returns a key (URI) and related information managed in the cache.

    cache_map/expire_time

    The expiration time of the item.

    cache_map/key

    The URI of the item.

    cache_map/size

    The total size of the cache item.

    cache_map_size

    The number of cache items currently managed in the cache.

    memory_usage

    The total amount of memory used by the cache item content. (Unit: bytes).

/cacherefresh

Removes the response data from the WebtoB HTTP response cache.

  • Usage

    {
       "url": string,
       "ext": string
    }
    Option Description

    None

    Clears the entire cache.

    url

    Specifies the URL of the cache to be removed.

    ext

    Specifies the extension of the cache to be removed.

    Only one of url or ext can be specified.

    The following is an example of removing the response for "test.domain.com/test.html" from the cache using the "/cacherefresh" Admin API.

    [Request]
    {
       "url": "test.domain.com/test.html"
    }
    
    [Response]
    "result": {
       "HTH-0": {
           "removed_count": 1
       }
    }

    The following describes each output item.

    Item Description

    removed_count

    The number of cache items that were removed.