Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
8 changes: 0 additions & 8 deletions specification/_spec_utils/behaviors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,14 +105,6 @@ export interface CommonCatQueryParameters {
* @server_default false
*/
help?: boolean
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean
/**
* Period to wait for a connection to the master node.
* @server_default 30s
Expand Down
8 changes: 8 additions & 0 deletions specification/cat/allocation/CatAllocationRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,13 @@ export interface Request extends CatRequestBase {
query_parameters: {
/** The unit used to display byte values. */
bytes?: Bytes
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,14 @@ export interface Request extends CatRequestBase {
/** The name of the component template. Accepts wildcard expressions. If omitted, all component templates are returned. */
name?: string
}
query_parameters: {
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean
}
}
8 changes: 8 additions & 0 deletions specification/cat/indices/CatIndicesRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,13 @@ export interface Request extends CatRequestBase {
pri?: boolean
/** The unit used to display time values. */
time?: TimeUnit
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local isn't in the JSON spec or the source for _cat/indices: https://github.com/elastic/elasticsearch/blob/35c6b60c773917b48c93b428305ba844f6a27903/server/src/main/java/org/elasticsearch/rest/action/cat/RestIndicesAction.java#L59

Suggested change
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't reject it like the other requests which doesn't support it. I think it just does nothing though, I'm removing it

}
}
13 changes: 12 additions & 1 deletion specification/cat/master/CatMasterRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ import { CatRequestBase } from '@cat/_types/CatBase'
* @doc_id cat-master
* @cluster_privileges monitor
*/
export interface Request extends CatRequestBase {}
export interface Request extends CatRequestBase {
query_parameters: {
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean
}
}
13 changes: 12 additions & 1 deletion specification/cat/nodeattrs/CatNodeAttributesRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ import { CatRequestBase } from '@cat/_types/CatBase'
* @doc_id cat-nodeattrs
* @cluster_privileges monitor
*/
export interface Request extends CatRequestBase {}
export interface Request extends CatRequestBase {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reduce code duplication, would it help to add a CatWithLocalRequestBase that each of these can extend?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure that works too, I'll do it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires a change in the compiler:

// CatRequestBase is special as it's a "marker" base class that doesn't imply a property body type. We should get rid of it.
} else if (parent.name === 'CatRequestBase' && parent.namespace === 'cat._types') {
// nothing to do

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think it's worth modifying the compiler for cat, so if it's okay I'd merge it as is

query_parameters: {
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean
}
}
13 changes: 12 additions & 1 deletion specification/cat/pending_tasks/CatPendingTasksRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ import { CatRequestBase } from '@cat/_types/CatBase'
* @doc_id cat-pending-tasks
* @cluster_privileges monitor
*/
export interface Request extends CatRequestBase {}
export interface Request extends CatRequestBase {
query_parameters: {
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean
}
}
13 changes: 12 additions & 1 deletion specification/cat/plugins/CatPluginsRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ import { CatRequestBase } from '@cat/_types/CatBase'
* @doc_id cat-plugins
* @cluster_privileges monitor
*/
export interface Request extends CatRequestBase {}
export interface Request extends CatRequestBase {
query_parameters: {
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean
}
}
8 changes: 8 additions & 0 deletions specification/cat/segments/CatSegmentsRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,13 @@ export interface Request extends CatRequestBase {
* The unit used to display byte values.
*/
bytes?: Bytes
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean
}
}
10 changes: 10 additions & 0 deletions specification/cat/templates/CatTemplatesRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,14 @@ export interface Request extends CatRequestBase {
*/
name?: Name
}
query_parameters: {
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean
}
}
8 changes: 8 additions & 0 deletions specification/cat/thread_pool/CatThreadPoolRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,13 @@ export interface Request extends CatRequestBase {
* The unit used to display time values.
*/
time?: TimeUnit
/**
* If `true`, the request computes the list of selected nodes from the
* local cluster state. If `false` the list of selected nodes are computed
* from the cluster state of the master node. In both cases the coordinating
* node will send requests for further information to each selected node.
* @server_default false
*/
local?: boolean
}
}