Skip to content
Merged
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
14 changes: 10 additions & 4 deletions src/ApiGenerator/RestSpecification/Core/nodes.info.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@
"transport",
"http",
"plugins",
"ingest"
"ingest",
"indices",
"aggregations"
],
"description":"A comma-separated list of metrics you wish returned. Leave empty to return all."
"description":"A comma-separated list of metrics you wish returned. Leave empty to return all metrics."
}
}
},
Expand All @@ -73,9 +75,13 @@
"transport",
"http",
"plugins",
"ingest"
"ingest",
"indices",
"aggregations",
"_all",
"_none"
],
"description":"A comma-separated list of metrics you wish returned. Leave empty to return all."
"description":"A comma-separated list of metrics you wish returned. Use `_all` to retrieve all metrics and `_none` to retrieve the node identity without any additional metrics."
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/ApiGenerator/RestSpecification/Core/nodes.stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"store",
"warmer",
"suggest",
"shards"
"shard_stats"
],
"description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified."
}
Expand Down Expand Up @@ -177,7 +177,7 @@
"store",
"warmer",
"suggest",
"shards"
"shard_stats"
],
"description":"Limit the information returned for `indices` metric to the specific index metrics. Isn't used if `indices` (or `all`) metric isn't specified."
},
Expand Down
18 changes: 17 additions & 1 deletion src/Elasticsearch.Net/Api/Enums.Generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,15 @@ public enum NodesInfoMetric
[EnumMember(Value = "plugins")]
Plugins = 1 << 7,
[EnumMember(Value = "ingest")]
Ingest = 1 << 8
Ingest = 1 << 8,
[EnumMember(Value = "indices")]
Indices = 1 << 9,
[EnumMember(Value = "aggregations")]
Aggregations = 1 << 10,
[EnumMember(Value = "_none")]
None = 1 << 11,
[EnumMember(Value = "_all")]
All = 1 << 12
}

[Flags, StringEnum]
Expand Down Expand Up @@ -569,6 +577,8 @@ public static string GetStringValue(this IndicesStatsMetric enumValue)

public static string GetStringValue(this NodesInfoMetric enumValue)
{
if ((enumValue & NodesInfoMetric.All) != 0)
return "_all";
var list = new List<string>();
if ((enumValue & NodesInfoMetric.Settings) != 0)
list.Add("settings");
Expand All @@ -588,6 +598,12 @@ public static string GetStringValue(this NodesInfoMetric enumValue)
list.Add("plugins");
if ((enumValue & NodesInfoMetric.Ingest) != 0)
list.Add("ingest");
if ((enumValue & NodesInfoMetric.Indices) != 0)
list.Add("indices");
if ((enumValue & NodesInfoMetric.Aggregations) != 0)
list.Add("aggregations");
if ((enumValue & NodesInfoMetric.None) != 0)
list.Add("_none");
return string.Join(",", list);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Elasticsearch.Net/ElasticLowLevelClient.Nodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,25 +115,25 @@ public TResponse Info<TResponse>(string nodeId, NodesInfoRequestParameters reque
public Task<TResponse> InfoAsync<TResponse>(string nodeId, NodesInfoRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_nodes/{nodeId:nodeId}"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /_nodes/{metric} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html</para></summary>
///<param name = "metric">A comma-separated list of metrics you wish returned. Leave empty to return all.</param>
///<param name = "metric">A comma-separated list of metrics you wish returned. Use `_all` to retrieve all metrics and `_none` to retrieve the node identity without any additional metrics.</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse InfoForAll<TResponse>(string metric, NodesInfoRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"_nodes/{metric:metric}"), null, RequestParams(requestParameters));
///<summary>GET on /_nodes/{metric} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html</para></summary>
///<param name = "metric">A comma-separated list of metrics you wish returned. Leave empty to return all.</param>
///<param name = "metric">A comma-separated list of metrics you wish returned. Use `_all` to retrieve all metrics and `_none` to retrieve the node identity without any additional metrics.</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
[MapsApi("nodes.info", "metric")]
public Task<TResponse> InfoForAllAsync<TResponse>(string metric, NodesInfoRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_nodes/{metric:metric}"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /_nodes/{node_id}/{metric} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html</para></summary>
///<param name = "nodeId">A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you&#x27;re connecting to, leave empty to get information from all nodes</param>
///<param name = "metric">A comma-separated list of metrics you wish returned. Leave empty to return all.</param>
///<param name = "metric">A comma-separated list of metrics you wish returned. Use `_all` to retrieve all metrics and `_none` to retrieve the node identity without any additional metrics.</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse Info<TResponse>(string nodeId, string metric, NodesInfoRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"_nodes/{nodeId:nodeId}/{metric:metric}"), null, RequestParams(requestParameters));
///<summary>GET on /_nodes/{node_id}/{metric} <para>https://www.elastic.co/guide/en/elasticsearch/reference/master/cluster-nodes-info.html</para></summary>
///<param name = "nodeId">A comma-separated list of node IDs or names to limit the returned information; use `_local` to return information from the node you&#x27;re connecting to, leave empty to get information from all nodes</param>
///<param name = "metric">A comma-separated list of metrics you wish returned. Leave empty to return all.</param>
///<param name = "metric">A comma-separated list of metrics you wish returned. Use `_all` to retrieve all metrics and `_none` to retrieve the node identity without any additional metrics.</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
[MapsApi("nodes.info", "node_id, metric")]
public Task<TResponse> InfoAsync<TResponse>(string nodeId, string metric, NodesInfoRequestParameters requestParameters = null, CancellationToken ctx = default)
Expand Down