Back to Redis

Index

content/operate/rs/references/rest-api/requests/proxies/_index.md

latest8.0 KB
Original Source
MethodPathDescription
GET/v1/proxiesGet all proxies
GET/v1/proxies/{uid}Get a proxy
PUT/v1/proxies/{uid}Update a proxy
PUT/v1/proxiesUpdate all proxies

Get all proxies {#get-all-proxies}

sh
GET /v1/proxies

Get all the proxies in the cluster.

Permissions

Permission nameRoles
[view_all_proxies_info]({{< relref "/operate/rs/references/rest-api/permissions#view_all_proxies_info" >}})admin
cluster_member
cluster_viewer
db_member
db_viewer
user_manager

Request {#get-all-request}

Example HTTP request

sh
GET /v1/proxies

Headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

Response {#get-all-response}

Returns a JSON array of [proxy objects]({{< relref "/operate/rs/references/rest-api/objects/proxy" >}}).

Example JSON body

json
[
    {
         "uid": 1,
         "client_keepintvl": 30,
         "max_worker_server_conns": 16384,
         "client_keepcnt": 6,
         "max_threads": 64,
         "ignore_bdb_cconn_output_buff_limits": false,
         "dynamic_threads_scaling": false,
         "max_worker_client_conns": 16384,
         "max_servers": 4096,
         "client_keepidle": 180,
         "duration_usage_threshold": 30,
         "max_worker_txns": 65536,
         "threads": 3,
         "max_listeners": 1024,
         "conns": 500000,
         "ignore_bdb_cconn_limit": false,
         "threads_usage_threshold": 80,
         "backlog": 1024
    },
    {
        "uid": 2,
        "threads": 3,
        // additional fields...
    }
]

Status codes {#get-all-status-codes}

CodeDescription
200 OKNo error

Get proxy {#get-proxy}

sh
GET /v1/proxies/{int: uid}

Get a single proxy's info.

Permissions

Permission nameRoles
[view_proxy_info]({{< relref "/operate/rs/references/rest-api/permissions#view_proxy_info" >}})admin
cluster_member
cluster_viewer
db_member
db_viewer
user_manager

Request {#get-request}

Example HTTP request

sh
GET /v1/proxies/1

Headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

URL parameters

FieldTypeDescription
uidintegerThe proxy's unique node ID

Response {#get-response}

Returns a [proxy object]({{< relref "/operate/rs/references/rest-api/objects/proxy" >}}).

Example JSON body

json
{
     "uid": 1,
     "client_keepintvl": 30,
     "max_worker_server_conns": 16384,
     "client_keepcnt": 6,
     "max_threads": 64,
     "ignore_bdb_cconn_output_buff_limits": false,
     "dynamic_threads_scaling": false,
     "max_worker_client_conns": 16384,
     "max_servers": 4096,
     "client_keepidle": 180,
     "duration_usage_threshold": 30,
     "max_worker_txns": 65536,
     "threads": 3,
     "max_listeners": 1024,
     "conns": 500000,
     "ignore_bdb_cconn_limit": false,
     "threads_usage_threshold": 80,
     "backlog": 1024
}

Status codes {#get-status-codes}

CodeDescription
200 OKNo error
404 Not FoundProxy UID does not exist

Update proxy {#put-proxy}

sh
PUT /v1/proxies/{int: uid}

Updates a proxy object, notifies the proxy, and waits for acknowledgment (ACK) unless the node is dead.

Automatically restarts the proxy service if allow_restart is true and any updated parameters require a restart for the changes to take effect. For example, a restart is required if you change threads to a lower number.

However, if allow_restart is false, such changes only take effect after the next proxy restart.

Permissions

Permission nameRoles
[update_proxy]({{< relref "/operate/rs/references/rest-api/permissions#update_proxy" >}})admin
user_manager

Request {#put-request}

Example HTTP request

sh
PUT /v1/proxies/1

Example JSON body

json
{
  "allow_restart": true,
  "proxy": {
    "threads": 8
  }
}

Headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type
Content-Typeapplication/jsonRequest body media type

URL parameters

FieldTypeDescription
uidintegerThe unique ID of the updated proxy. Corresponds to the node ID.

Request body

Include a JSON object in the request body. The JSON object can contain the boolean field allow_restart and a [proxy object]({{< relref "/operate/rs/references/rest-api/objects/proxy" >}}) with updated fields.

Response {#put-response}

Returns a status code to indicate the success or failure of the proxy update.

Status codes {#put-status-codes}

CodeDescription
200 OKNo error, the request has been processed
400 Bad RequestBad content provided
404 Not FoundProxy does not exist
500 Internal Server ErrorError while waiting for confirmation from proxy
504 Gateway TimeoutTimeout while waiting for confirmation from proxy

Update all proxies {#put-all-proxies}

sh
PUT /v1/proxies

Updates all the proxy objects, notifies the proxies, and waits for acknowledgment (ACK) unless the node is dead.

Automatically restarts the relevant proxy services if allow_restart is true and any updated parameters require a restart for the changes to take effect.

However, if allow_restart is false, such changes only take effect after the next proxy restart.

Permissions

Permission nameRoles
[update_proxy]({{< relref "/operate/rs/references/rest-api/permissions#update_proxy" >}})admin
user_manager

Request {#put-all-request}

Example HTTP request

sh
PUT /v1/proxies

Example JSON body

json
{
  "allow_restart": true,
  "proxy": {
    "threads": 8,
    "max_threads": 12
  }
}

Headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type
Content-Typeapplication/jsonRequest body media type

Request body

Include a JSON object in the request body. The JSON object can contain the boolean field allow_restart and a [proxy object]({{< relref "/operate/rs/references/rest-api/objects/proxy" >}}) with updated fields.

Response {#put-all-response}

Returns a status code to indicate the success or failure of the proxy updates.

Status codes {#put-all-status-codes}

CodeDescription
200 OKNo error, the request has been processed
400 Bad RequestBad content provided
500 Internal Server ErrorError while waiting for confirmation from proxy
504 Gateway TimeoutTimeout while waiting for confirmation from proxy