-
Notifications
You must be signed in to change notification settings - Fork 276
RS: Add services REST API reference #1164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 7 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c9cd58d
DOC-3669 RS: Add REST API reference for /services
rrelledge e4dbd92
Merge branch 'main' into DOC-3669
rrelledge 46e6cbb
Merge branch 'main' into DOC-3669
rrelledge 9b813d0
Merge branch 'main' into DOC-3669
rrelledge 8cbb5ca
DOC-3669 Feedback update - only list start, stop, restart operations …
rrelledge 54be27f
Merge branch 'main' into DOC-3669
rrelledge cb6656e
DOC-3669 Feedback update to note the POST services request should be …
rrelledge c98ffbd
Fix 200 OK links
rrelledge fd0c691
Merge branch 'main' into DOC-3669
rrelledge 47fbff1
DOC-3669 Feedback update to emphasize the warning that this API is da…
rrelledge File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
212 changes: 212 additions & 0 deletions
212
content/operate/rs/references/rest-api/requests/services/_index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,212 @@ | ||
| --- | ||
| Title: Services requests | ||
| alwaysopen: false | ||
| categories: | ||
| - docs | ||
| - operate | ||
| - rs | ||
| description: REST API requests to list or modify Redis Enterprise services. | ||
| headerRange: '[1-2]' | ||
| hideListLinks: true | ||
| linkTitle: services | ||
| weight: $weight | ||
| --- | ||
|
|
||
| | Method | Path | Description | | ||
| |--------|------|-------------| | ||
| | [GET](#get-local-services) | `/v1/local/services` | List Redis Enterprise services on the local node | | ||
| | [POST](#post-local-services) | `/v1/local/services` | Modify or perform operations on local processes | | ||
| | [POST](#post-services) | `/v1/services` | Apply cluster-wide changes to services | | ||
|
|
||
| ## Get local services {#get-local-services} | ||
|
|
||
| ```sh | ||
| GET /v1/local/services | ||
| ``` | ||
|
|
||
| Lists all Redis Enterprise services currently running on the local node and relevant metadata. | ||
|
|
||
| ### Request {#get-request} | ||
|
|
||
| #### Example HTTP request | ||
|
|
||
| ```sh | ||
| GET /local/services | ||
| ``` | ||
|
|
||
|
|
||
| #### Headers | ||
|
|
||
| | Key | Value | Description | | ||
| |-----|-------|-------------| | ||
| | Host | cnm.cluster.fqdn | Domain name | | ||
| | Accept | application/json | Accepted media type | | ||
|
|
||
|
|
||
| ### Response {#get-response} | ||
|
|
||
| Returns a JSON object that describes all Redis Enterprise 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} | ||
|
|
||
| | Code | Description | | ||
| |------|-------------| | ||
| | [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error | | ||
|
|
||
| ## Modify local services {#post-local-services} | ||
|
|
||
| ```sh | ||
| POST /v1/local/services | ||
| ``` | ||
|
|
||
| Modify Redis Enterprise services or perform operations that directly interact with processes. For cluster-wide changes that are not node-specific, use [`POST /v1/services`](#post-services) instead. | ||
|
|
||
| Supported `operation_type` values: | ||
|
|
||
| - stop | ||
| - start | ||
| - restart | ||
|
|
||
| {{<warning>}} | ||
| Stop, start, or restart optional services only. Changing the status of required services can affect cluster behavior. | ||
|
|
||
| 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 /local/services | ||
| ``` | ||
|
|
||
| #### Headers | ||
|
|
||
| | Key | Value | Description | | ||
| |-----|-------|-------------| | ||
| | Host | cnm.cluster.fqdn | Domain name | | ||
| | Accept | application/json | Accepted 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} | ||
|
|
||
| | Code | Description | | ||
| |------|-------------| | ||
| | [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error. | | ||
|
|
||
| ## Apply cluster-wide service changes {#post-services} | ||
|
|
||
| ```sh | ||
| POST /v1/services | ||
| ``` | ||
|
|
||
| Makes cluster-wide changes that are not node-specific on Redis Enterprise services. The master node handles these changes. For operations that directly interact with processes, use [`POST /v1/local/services`](#post-local-services) instead. | ||
|
|
||
| Supported `operation_type` values: | ||
|
|
||
| - stop | ||
| - start | ||
| - restart | ||
|
|
||
| {{<warning>}} | ||
| Stop, start, or restart optional services only. Changing the status of required services can affect cluster behavior. | ||
|
|
||
| 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 /services | ||
| ``` | ||
|
|
||
| #### Headers | ||
|
|
||
| | Key | Value | Description | | ||
| |-----|-------|-------------| | ||
| | Host | cnm.cluster.fqdn | Domain name | | ||
| | Accept | application/json | Accepted 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} | ||
|
|
||
| | Code | Description | | ||
| |------|-------------| | ||
| | [200 OK](http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.2.1) | No error. | | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.