Skip to content

[DRAFT] Nodes.info Response #332

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
298 changes: 268 additions & 30 deletions output/schema/schema.json

Large diffs are not rendered by default.

54 changes: 37 additions & 17 deletions output/typescript/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8779,33 +8779,34 @@ export interface NodeInfo {
network: NodeInfoNetwork
os: NodeOperatingSystemInfo
plugins: Array<PluginStats>
process: NodeProcessInfo
process?: NodeProcessInfo
roles: Array<NodeRole>
settings: Array<string>
settings: NodeSettings
thread_pool: Record<string, NodeThreadPoolInfo>
total_indexing_buffer: long
total_indexing_buffer_in_bytes?: ByteSize
transport: NodeInfoTransport
transport_address: string
version: VersionString
}

export interface NodeInfoHttp {
bound_address: Array<string>
max_content_length: string
max_content_length?: ByteSize
max_content_length_in_bytes: long
publish_address: string
}

export interface NodeInfoJvmMemory {
direct_max: string
direct_max?: ByteSize
direct_max_in_bytes: long
heap_init: string
heap_init?: ByteSize
heap_init_in_bytes: long
heap_max: string
heap_max?: ByteSize
heap_max_in_bytes: long
non_heap_init: string
non_heap_init?: ByteSize
non_heap_init_in_bytes: long
non_heap_max: string
non_heap_max?: ByteSize
non_heap_max_in_bytes: long
}

Expand Down Expand Up @@ -8839,6 +8840,7 @@ export interface NodeInfoOSCPU {
export interface NodeInfoTransport {
bound_address: Array<string>
publish_address: string
profiles: Record<string, string>
}

export interface NodeIngestStats {
Expand All @@ -8848,6 +8850,7 @@ export interface NodeIngestStats {

export interface NodeJvmInfo {
gc_collectors: Array<string>
input_arguments: Array<string>
mem: NodeInfoJvmMemory
memory_pools: Array<string>
pid: integer
Expand All @@ -8856,6 +8859,9 @@ export interface NodeJvmInfo {
vm_name: Name
vm_vendor: string
vm_version: VersionString
bundled_jdk: boolean
using_bundled_jdk: boolean
using_compressed_ordinary_object_pointers: boolean | string
}

export interface NodeJvmStats {
Expand All @@ -8874,12 +8880,13 @@ export type NodeName = string
export interface NodeOperatingSystemInfo {
arch: string
available_processors: integer
cpu: NodeInfoOSCPU
mem: NodeInfoMemory
name: string
allocated_processors?: integer
cpu?: NodeInfoOSCPU
mem?: NodeInfoMemory
name: Name
pretty_name: Name
refresh_interval_in_millis: integer
swap: NodeInfoMemory
swap?: NodeInfoMemory
version: VersionString
}

Expand Down Expand Up @@ -8910,6 +8917,17 @@ export type NodeRole = 'master' | 'data' | 'data_cold' | 'data_content' | 'data_

export type NodeRoles = Array<NodeRole>

export interface NodeSettings {
routing?: IndexSettingRouting
client?: Record<string, string>
cluster?: NodeSettingsCluster
}

export interface NodeSettingsCluster {
name: Name
election: Record<string, string>
}

export interface NodeStatistics {
failed: integer
failures?: Array<ErrorCause>
Expand Down Expand Up @@ -8939,11 +8957,11 @@ export interface NodeStats {
}

export interface NodeThreadPoolInfo {
core: integer
keep_alive: string
max: integer
core?: integer
keep_alive?: string
max?: integer
queue_size: integer
size: integer
size?: integer
type: string
}

Expand Down Expand Up @@ -8972,11 +8990,13 @@ export interface NodesInfoRequest extends RequestBase {
node_id?: NodeIds
metric?: Metrics
flat_settings?: boolean
master_timeout?: Time
timeout?: Time
}

export interface NodesInfoResponse extends NodesResponseBase {
cluster_name: string
_nodes: NodeStatistics
cluster_name: Name
nodes: Record<string, NodeInfo>
}

Expand Down
29 changes: 29 additions & 0 deletions specification/specs/cluster/NodeSettings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

class NodeSettings {
routing?: IndexSettingRouting
client?: Dictionary<string, string>
cluster?: NodeSettingsCluster
}

class NodeSettingsCluster {
name: Name
election: Dictionary<string, string>
}
18 changes: 15 additions & 3 deletions specification/specs/cluster/nodes_info/NodeInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,35 @@
class NodeInfo {
attributes: Dictionary<string, string>
build_flavor: string
/** Short hash of the last git commit in this release. */
build_hash: string
build_type: string
/** The node’s host name. */
host: string
http: NodeInfoHttp
/** The node’s IP address. */
ip: string
jvm: NodeJvmInfo
/** The node’s name. */
name: string
network: NodeInfoNetwork
os: NodeOperatingSystemInfo
plugins: PluginStats[]
process: NodeProcessInfo
/** The process flag can be set to retrieve information that concern the current running process */
process?: NodeProcessInfo
roles: NodeRole[]
settings: string[]
/** @prop_serializer VerbatimInterfaceReadOnlyDictionaryKeysFormatter`2 */
settings: NodeSettings
thread_pool: Dictionary<string, NodeThreadPoolInfo>
/**
* Total heap allowed to be used to hold recently indexed documents before they must be written to disk. This size is a shared pool across all shards on this node, and is controlled by Indexing Buffer settings.
* @doc_url https://www.elastic.co/guide/en/elasticsearch/reference/master/indexing-buffer.html
*/
total_indexing_buffer: long
/** Same as total_indexing_buffer, but expressed in bytes. */
total_indexing_buffer_in_bytes?: ByteSize
transport: NodeInfoTransport
/** Host and port where transport HTTP connections are accepted. */
transport_address: string
/** Elasticsearch version running on this node. */
version: VersionString
}
2 changes: 1 addition & 1 deletion specification/specs/cluster/nodes_info/NodeInfoHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class NodeInfoHttp {
bound_address: string[]
max_content_length: string
max_content_length?: ByteSize
max_content_length_in_bytes: long
publish_address: string
}
10 changes: 5 additions & 5 deletions specification/specs/cluster/nodes_info/NodeInfoJvmMemory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
*/

class NodeInfoJvmMemory {
direct_max: string
direct_max?: ByteSize
direct_max_in_bytes: long
heap_init: string
heap_init?: ByteSize
heap_init_in_bytes: long
heap_max: string
heap_max?: ByteSize
heap_max_in_bytes: long
non_heap_init: string
non_heap_init?: ByteSize
non_heap_init_in_bytes: long
non_heap_max: string
non_heap_max?: ByteSize
non_heap_max_in_bytes: long
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
class NodeInfoTransport {
bound_address: string[]
publish_address: string
profiles: Dictionary<string, string>
}
4 changes: 4 additions & 0 deletions specification/specs/cluster/nodes_info/NodeJvmInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

class NodeJvmInfo {
gc_collectors: string[]
input_arguments: string[]
mem: NodeInfoJvmMemory
memory_pools: string[]
pid: integer
Expand All @@ -27,4 +28,7 @@ class NodeJvmInfo {
vm_name: Name
vm_vendor: string
vm_version: VersionString
bundled_jdk: boolean
using_bundled_jdk: boolean
using_compressed_ordinary_object_pointers: boolean | string // TODO: should be only boolean, needs upstream fix
}
14 changes: 10 additions & 4 deletions specification/specs/cluster/nodes_info/NodeOperatingSystemInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@
*/

class NodeOperatingSystemInfo {
/** Name of the JVM architecture (ex: amd64, x86) */
arch: string
/** Number of processors available to the Java virtual machine */
available_processors: integer
cpu: NodeInfoOSCPU
mem: NodeInfoMemory
name: string
allocated_processors?: integer
cpu?: NodeInfoOSCPU
mem?: NodeInfoMemory
/** Name of the operating system (ex: Linux, Windows, Mac OS X) */
name: Name
pretty_name: Name
/** Refresh interval for the OS statistics */
refresh_interval_in_millis: integer
swap: NodeInfoMemory
swap?: NodeInfoMemory
/** Version of the operating system */
version: VersionString
}
3 changes: 3 additions & 0 deletions specification/specs/cluster/nodes_info/NodeProcessInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
*/

class NodeProcessInfo {
/** Process identifier (PID) */
id: long
/** Indicates if the process address space has been successfully locked in memory */
mlockall: boolean
/** Refresh interval for the process statistics */
refresh_interval_in_millis: long
}
8 changes: 4 additions & 4 deletions specification/specs/cluster/nodes_info/NodeThreadPoolInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/

class NodeThreadPoolInfo {
core: integer
keep_alive: string
max: integer
core?: integer
keep_alive?: string
max?: integer
queue_size: integer
size: integer
size?: integer
type: string
}
23 changes: 21 additions & 2 deletions specification/specs/cluster/nodes_info/NodesInfoRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,37 @@
*/

/**
* The cluster nodes info API allows to retrieve one or more (or all) of the cluster nodes information. By default, it returns all attributes and core settings for a node.
* @rest_spec_name nodes.info
* @since 0.0.0
* @since 1.3.0
* @stability TODO
*/
interface NodesInfoRequest extends RequestBase {
path_parts?: {
/**
* Comma-separated list of node IDs or names used to limit returned information.
*/
node_id?: NodeIds
/**
* Limits the information returned to the specific metrics. Supports a comma-separated list, such as http,ingest.
*/
metric?: Metrics
}
query_parameters?: {
/**
* If true, returns settings in flat format.
* @server_default false
*/
flat_settings?: boolean
/**
* Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.
* @server_default 30s
*/
master_timeout?: Time
/**
* Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.
* @server_default 30s
*/
timeout?: Time
}
body?: {}
}
4 changes: 2 additions & 2 deletions specification/specs/cluster/nodes_info/NodesInfoResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/

class NodesInfoResponse extends NodesResponseBase {
cluster_name: string
/** @prop_serializer VerbatimInterfaceReadOnlyDictionaryKeysFormatter`2 */
_nodes: NodeStatistics
cluster_name: Name
nodes: Dictionary<string, NodeInfo>
}