Nodes Usage API
Nodes Usage API
1.0에서 도입
nodes usage 엔드포인트는 노드에서 REST action 사용에 대한 저수준 정보를 반환해요.
출처: 문서
본문
엔드포인트 (Endpoints)
GET _nodes/usage
GET _nodes/{node_id}/usage
GET _nodes/usage/{metric}
GET _nodes/{node_id}/usage/{metric}
경로 매개변수 (Path parameters)
요청에 다음 선택적 경로 매개변수를 포함할 수 있어요.
| 매개변수 | 타입 | 설명 |
|---|---|---|
node_id |
String | 결과를 필터링하는 데 사용하는 쉼표로 구분된 노드 ID 목록이에요. 노드 필터를 지원해요. 기본값은 _all이에요. |
metric |
String | 응답에 포함할 메트릭이에요. _all 또는 rest_actions로 설정할 수 있어요. rest_actions는 노드에서 action이 호출된 총 횟수를 반환하고, _all은 노드의 모든 통계를 반환해요. 기본값은 _all이에요. |
쿼리 매개변수 (Query parameters)
요청에 다음 선택적 쿼리 매개변수를 포함할 수 있어요.
| 매개변수 | 타입 | 설명 |
|---|---|---|
timeout |
Time | 노드 응답의 시간 제한을 설정해요. 기본값은 30s예요. |
cluster_manager_timeout |
Time | 클러스터 매니저 응답의 시간 제한을 설정해요. 기본값은 30s예요. |
예시 요청 (Example request)
다음 요청은 모든 노드의 사용 상세를 반환해요.
GET /_nodes/usage
Python 클라이언트로는 이렇게 호출해요:
response = client.nodes.info(
node_id_or_metric = "usage"
)
예시 응답 (Example response)
다음은 응답의 예시예요.
{
"_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)
Security 플러그인을 사용한다면 다음 권한을 설정해줘야 해요: cluster:manage/nodes 또는 cluster:monitor/nodes.