Add documentation for nodes api (#1560)

* adding documentation for nodes api

Signed-off-by: ariamarble <armarble@amazon.com>

* made suggested changes

Signed-off-by: ariamarble <armarble@amazon.com>

* minor format change

Signed-off-by: ariamarble <armarble@amazon.com>

* quick terminology changes

Signed-off-by: ariamarble <armarble@amazon.com>

* editorial changes

Signed-off-by: ariamarble <armarble@amazon.com>

Signed-off-by: ariamarble <armarble@amazon.com>
This commit is contained in:
Aria Marble 2022-10-14 08:25:33 -07:00 committed by GitHub
parent 15697d9bcf
commit 82b2416df3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 163 additions and 0 deletions

View File

@ -0,0 +1,68 @@
---
layout: default
title: Nodes reload secure settings
parent: Nodes APIs
grand_parent: REST API reference
nav_order: 50
---
# Nodes reload secure settings
The nodes reload secure settings endpoint allows you to change secure settings on a node and reload the secure settings without restarting the node.
## Path and HTTP methods
```
POST _nodes/reload_secure_settings
POST _nodes/<nodeId>/reload_secure_settings
```
## Path parameter
You can include the following optional path parameter in your request.
Parameter | Type | Description
:--- | :--- | :---
nodeId | String | A comma-separated list of nodeIds used to filter results. Supports [node filters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/nodes-apis/index/#node-filters). Defaults to `_all`.
## Request fields
The request may include an optional object containing the password for the OpenSearch keystore.
```json
{
"secure_settings_password": "keystore_password"
}
```
#### Sample request
The following is an example API request:
```
POST _nodes/reload_secure_settings
```
#### Sample response
The following is an example response:
```json
{
"_nodes" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"cluster_name" : "opensearch-cluster",
"nodes" : {
"t7uqHu4SSuWObK3ElkCRfw" : {
"name" : "opensearch-node1"
}
}
}
```
## Required permissions
If you use the security plugin, make sure you set the following permissions: `cluster:manage/nodes`.

View File

@ -0,0 +1,95 @@
---
layout: default
title: Nodes usage
parent: Nodes APIs
grand_parent: REST API reference
nav_order: 40
---
# Nodes usage
The nodes usage endpoint returns low-level information about REST action usage on nodes.
## Path and HTTP methods
```
GET _nodes/usage
GET _nodes/<nodeId>/usage
GET _nodes/usage/<metric>
GET _nodes/<nodeId>/usage/<metric>
```
## Path parameters
You can include the following optional path parameters in your request.
Parameter | Type | Description
:--- | :--- | :---
nodeId | String | A comma-separated list of nodeIds used to filter results. Supports [node filters]({{site.url}}{{site.baseurl}}/opensearch/rest-api/nodes-apis/index/#node-filters). Defaults to `_all`.
metric | String | The metrics that will be included in the response. You can set the string to either `_all` or `rest_actions`. `rest_actions` returns the total number of times an action has been called on the node. `_all` returns all stats from the node. Defaults to `_all`.
## Query parameters
You can include the following optional query parameters in your request.
Parameter | Type | Description
:--- | :---| :---
timeout | Time | Sets the time limit for a response from the node. Default is `30s`.
cluster_manager_timeout | Time | Sets the time limit for a response from the cluster manager. Default is `30s`.
#### Sample request
The following request returns usage details for all nodes:
```
GET _nodes/usage
```
#### Sample response
The following is an example response:
```json
{
"_nodes" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"cluster_name" : "opensearch-cluster",
"nodes" : {
"t7uqHu4SSuWObK3ElkCRfw" : {
"timestamp" : 1665695174312,
"since" : 1663994849643,
"rest_actions" : {
"opendistro_get_rollup_action" : 3,
"nodes_usage_action" : 1,
"list_dangling_indices" : 1,
"get_index_template_action" : 258,
"nodes_info_action" : 152665,
"get_mapping_action" : 259,
"get_data_streams_action" : 12,
"cat_indices_action" : 6,
"get_indices_action" : 3,
"ism_explain_action" : 7,
"nodes_reload_action" : 1,
"get_policy_action" : 3,
"PerformanceAnalyzerClusterConfigAction" : 2,
"index_policy_action" : 1,
"rank_eval_action" : 3,
"search_action" : 592,
"get_aliases_action" : 258,
"document_mget_action" : 2,
"document_get_action" : 30,
"count_action" : 1,
"main_action" : 1
},
"aggregations" : { }
}
}
}
```
## Required permissions
If you use the security plugin, make sure you set the following permissions: `cluster:manage/nodes` or `cluster:monitor/nodes`.