Back to Redis

Index

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

latest5.7 KB
Original Source
MethodPathDescription
GET/v1/local/servicesList Redis Software services on the local node
POST/v1/local/servicesModify or perform operations on local processes
POST/v1/servicesApply cluster-wide changes to services

{{<warning>}} This API is dangerous and should only be run with guidance from Redis support.

Stop, start, or restart optional services only. Changing the status of required services can negatively affect cluster behavior and cause a complete loss of the cluster and its data.

For a list of optional services, see the [services configuration object reference]({{<relref "/operate/rs/references/rest-api/objects/services_configuration">}}) or use a [GET /v1/cluster/services_configuration]({{<relref "/operate/rs/references/rest-api/requests/cluster/services_configuration#get-cluster-services_config">}}) request. {{</warning>}}

Get local services {#get-local-services}

sh
GET /v1/local/services

Lists all Redis Software services currently running on the local node and relevant metadata.

Request {#get-request}

Example HTTP request

sh
GET /v1/local/services

Headers

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

Response {#get-response}

Returns a JSON object that describes all Redis Software services currently running on the local node and relevant metadata.

Possible status values:

  • RESTARTING
  • RUNNING
  • STARTING
  • STOPPED

Example JSON response body

json
{
    "alert_mgr": {
        "start_time": "2024-05-13T18:38:00Z",
        "status": "RUNNING",
        "uptime": "3 days, 0:58:59"
    },
    "ccs": {
        "start_time": "2024-05-13T18:38:59Z",
        "status": "RUNNING",
        "uptime": "3 days, 0:58:00"
    },
    ...
}

Status codes {#get-status-codes}

CodeDescription
200 OKNo error

Modify local services {#post-local-services}

sh
POST /v1/local/services

Modify Redis Software services or perform operations that directly interact with processes. For cluster-wide changes that are not node-specific, use POST /v1/services instead.

Supported operation_type values:

  • stop
  • start
  • restart

{{<warning>}} This API is dangerous and should only be run with guidance from Redis support.

Stop, start, or restart optional services only. Changing the status of required services can negatively affect cluster behavior and cause a complete loss of the cluster and its data.

For a list of optional services, see the [services configuration object reference]({{<relref "/operate/rs/references/rest-api/objects/services_configuration">}}) or use a [GET /v1/cluster/services_configuration]({{<relref "/operate/rs/references/rest-api/requests/cluster/services_configuration#get-cluster-services_config">}}) request. {{</warning>}}

Request {#post-local-request}

Example HTTP request

sh
POST /v1/local/services

Headers

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

Example JSON request body

json
{
  "operation_type": "restart",
  "services": [
    "alert_mgr"
  ]
}

Response {#post-local-response}

Returns a JSON object that shows whether the operation ran successfully or failed for each requested service.

Example JSON response body

json
{
    "alert_mgr": true,
    "metrics_exporter": true
}

Status codes {#post-local-status-codes}

CodeDescription
200 OKNo error.

Apply cluster-wide service changes {#post-services}

sh
POST /v1/services

Makes cluster-wide changes that are not node-specific on Redis Software services. The master node handles these changes. For operations that directly interact with processes, use POST /v1/local/services instead.

Supported operation_type values:

  • stop
  • start
  • restart

{{<warning>}} This API is dangerous and should only be run with guidance from Redis support.

Stop, start, or restart optional services only. Changing the status of required services can negatively affect cluster behavior and cause a complete loss of the cluster and its data.

For a list of optional services, see the [services configuration object reference]({{<relref "/operate/rs/references/rest-api/objects/services_configuration">}}) or use a [GET /v1/cluster/services_configuration]({{<relref "/operate/rs/references/rest-api/requests/cluster/services_configuration#get-cluster-services_config">}}) request. {{</warning>}}

Request {#post-request}

Example HTTP request

sh
POST /v1/services

Headers

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

Example JSON request body

json
{
  "operation_type": "restart",
  "services": [
    "alert_mgr"
  ]
}

Response {#post-response}

Returns a JSON object that shows whether the operation ran successfully or failed for each requested service.

Example JSON response body

json
{
    "alert_mgr": true,
    "metrics_exporter": true
}

Status codes {#post-status-codes}

CodeDescription
200 OKNo error.