From 82b2416df3e467b6aa9bf8da2f6bc0e2ef655e7a Mon Sep 17 00:00:00 2001 From: Aria Marble <111301581+ariamarble@users.noreply.github.com> Date: Fri, 14 Oct 2022 08:25:33 -0700 Subject: [PATCH] Add documentation for nodes api (#1560) * adding documentation for nodes api Signed-off-by: ariamarble * made suggested changes Signed-off-by: ariamarble * minor format change Signed-off-by: ariamarble * quick terminology changes Signed-off-by: ariamarble * editorial changes Signed-off-by: ariamarble Signed-off-by: ariamarble --- .../nodes-apis/nodes-reload-secure.md | 68 +++++++++++++ .../rest-api/nodes-apis/nodes-usage.md | 95 +++++++++++++++++++ 2 files changed, 163 insertions(+) create mode 100644 _opensearch/rest-api/nodes-apis/nodes-reload-secure.md create mode 100644 _opensearch/rest-api/nodes-apis/nodes-usage.md diff --git a/_opensearch/rest-api/nodes-apis/nodes-reload-secure.md b/_opensearch/rest-api/nodes-apis/nodes-reload-secure.md new file mode 100644 index 00000000..4dfa2efd --- /dev/null +++ b/_opensearch/rest-api/nodes-apis/nodes-reload-secure.md @@ -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//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`. \ No newline at end of file diff --git a/_opensearch/rest-api/nodes-apis/nodes-usage.md b/_opensearch/rest-api/nodes-apis/nodes-usage.md new file mode 100644 index 00000000..28678fb5 --- /dev/null +++ b/_opensearch/rest-api/nodes-apis/nodes-usage.md @@ -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//usage +GET _nodes/usage/ +GET _nodes//usage/ +``` + +## 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`. \ No newline at end of file