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
5 changes: 4 additions & 1 deletion docs/reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11330,6 +11330,7 @@ client.ml.stopTrainedModelDeployment({ model_id })

* *Request (object):*
** *`model_id` (string)*: The unique identifier of the trained model.
** *`id` (Optional, string)*: If provided, must be the same identifier as in the path.
** *`allow_no_match` (Optional, boolean)*: Specifies what to do when the request: contains wildcard expressions and there are no deployments that match;
contains the `_all` string or no identifiers and there are no matches; or contains wildcard expressions and
there are only partial matches. By default, it returns an empty array when there are no matches and the subset of results when there are partial matches.
Expand Down Expand Up @@ -16140,7 +16141,9 @@ index will not be deleted

[discrete]
==== get_node_stats
Retrieves transform usage information for transform nodes
Get node stats.

Get per-node information about transform usage.
[source,ts]
----
client.transform.getNodeStats()
Expand Down
52 changes: 44 additions & 8 deletions src/api/api/ml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2401,12 +2401,24 @@ export default class Ml {
async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlStartDataFrameAnalyticsResponse, unknown>>
async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise<T.MlStartDataFrameAnalyticsResponse>
async startDataFrameAnalytics (this: That, params: T.MlStartDataFrameAnalyticsRequest | TB.MlStartDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['id']
const acceptedPath: string[] = []
const acceptedBody: string[] = ['id', 'timeout']
const querystring: Record<string, any> = {}
const body = undefined
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}

for (const key in params) {
if (acceptedPath.includes(key)) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
Expand Down Expand Up @@ -2521,12 +2533,24 @@ export default class Ml {
async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.MlStopDataFrameAnalyticsResponse, unknown>>
async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise<T.MlStopDataFrameAnalyticsResponse>
async stopDataFrameAnalytics (this: That, params: T.MlStopDataFrameAnalyticsRequest | TB.MlStopDataFrameAnalyticsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['id']
const acceptedPath: string[] = []
const acceptedBody: string[] = ['id', 'allow_no_match', 'force', 'timeout']
const querystring: Record<string, any> = {}
const body = undefined
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}

for (const key in params) {
if (acceptedPath.includes(key)) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
Expand Down Expand Up @@ -2598,11 +2622,23 @@ export default class Ml {
async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest | TB.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise<T.MlStopTrainedModelDeploymentResponse>
async stopTrainedModelDeployment (this: That, params: T.MlStopTrainedModelDeploymentRequest | TB.MlStopTrainedModelDeploymentRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = ['model_id']
const acceptedBody: string[] = ['id', 'allow_no_match', 'force']
const querystring: Record<string, any> = {}
const body = undefined
// @ts-expect-error
const userBody: any = params?.body
let body: Record<string, any> | string
if (typeof userBody === 'string') {
body = userBody
} else {
body = userBody != null ? { ...userBody } : undefined
}

for (const key in params) {
if (acceptedPath.includes(key)) {
if (acceptedBody.includes(key)) {
body = body ?? {}
// @ts-expect-error
body[key] = params[key]
} else if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
Expand Down
12 changes: 6 additions & 6 deletions src/api/api/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,12 @@ export default class Transform {
}

/**
* Retrieves transform usage information for transform nodes
* @see {@link https://www.elastic.co/guide/en/elasticsearch/reference/8.19/get-transform-node-stats.html | Elasticsearch API documentation}
* Get node stats. Get per-node information about transform usage.
*/
async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithOutMeta): Promise<T.TODO>
async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TODO, unknown>>
async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<T.TODO>
async getNodeStats (this: That, params?: T.TODO | TB.TODO, options?: TransportRequestOptions): Promise<any> {
async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest | TB.TransformGetNodeStatsRequest, options?: TransportRequestOptionsWithOutMeta): Promise<T.TransformGetNodeStatsResponse>
async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest | TB.TransformGetNodeStatsRequest, options?: TransportRequestOptionsWithMeta): Promise<TransportResult<T.TransformGetNodeStatsResponse, unknown>>
async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest | TB.TransformGetNodeStatsRequest, options?: TransportRequestOptions): Promise<T.TransformGetNodeStatsResponse>
async getNodeStats (this: That, params?: T.TransformGetNodeStatsRequest | TB.TransformGetNodeStatsRequest, options?: TransportRequestOptions): Promise<any> {
const acceptedPath: string[] = []
const querystring: Record<string, any> = {}
const body = undefined
Expand All @@ -93,6 +92,7 @@ export default class Transform {
if (acceptedPath.includes(key)) {
continue
} else if (key !== 'body') {
// @ts-expect-error
querystring[key] = params[key]
}
}
Expand Down
27 changes: 22 additions & 5 deletions src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11679,14 +11679,10 @@ export interface IndicesDataStreamIndex {

export interface IndicesDataStreamLifecycle {
data_retention?: Duration
downsampling?: IndicesDataStreamLifecycleDownsampling
downsampling?: IndicesDownsamplingRound[]
enabled?: boolean
}

export interface IndicesDataStreamLifecycleDownsampling {
rounds: IndicesDownsamplingRound[]
}

export interface IndicesDataStreamLifecycleRolloverConditions {
min_age?: Duration
max_age?: string
Expand Down Expand Up @@ -17790,6 +17786,7 @@ export interface MlStopDatafeedResponse {

export interface MlStopTrainedModelDeploymentRequest extends RequestBase {
model_id: Id
id?: Id
allow_no_match?: boolean
force?: boolean
}
Expand Down Expand Up @@ -21900,6 +21897,26 @@ export interface TransformDeleteTransformRequest extends RequestBase {

export type TransformDeleteTransformResponse = AcknowledgedResponseBase

export interface TransformGetNodeStatsRequest extends RequestBase {
}

export type TransformGetNodeStatsResponse = TransformGetNodeStatsTransformNodeFullStats

export interface TransformGetNodeStatsTransformNodeFullStatsKeys {
total: TransformGetNodeStatsTransformNodeStats
}
export type TransformGetNodeStatsTransformNodeFullStats = TransformGetNodeStatsTransformNodeFullStatsKeys
& { [property: string]: TransformGetNodeStatsTransformNodeStats }

export interface TransformGetNodeStatsTransformNodeStats {
scheduler: TransformGetNodeStatsTransformSchedulerStats
}

export interface TransformGetNodeStatsTransformSchedulerStats {
registered_transform_count: integer
peek_transform?: string
}

export interface TransformGetTransformRequest extends RequestBase {
transform_id?: Names
allow_no_match?: boolean
Expand Down
50 changes: 39 additions & 11 deletions src/api/typesWithBodyKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11882,14 +11882,10 @@ export interface IndicesDataStreamIndex {

export interface IndicesDataStreamLifecycle {
data_retention?: Duration
downsampling?: IndicesDataStreamLifecycleDownsampling
downsampling?: IndicesDownsamplingRound[]
enabled?: boolean
}

export interface IndicesDataStreamLifecycleDownsampling {
rounds: IndicesDownsamplingRound[]
}

export interface IndicesDataStreamLifecycleRolloverConditions {
min_age?: Duration
max_age?: string
Expand Down Expand Up @@ -18161,7 +18157,11 @@ export type MlSetUpgradeModeResponse = AcknowledgedResponseBase

export interface MlStartDataFrameAnalyticsRequest extends RequestBase {
id: Id
timeout?: Duration
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
body?: {
id?: Id
timeout?: Duration
}
}

export interface MlStartDataFrameAnalyticsResponse {
Expand Down Expand Up @@ -18206,9 +18206,13 @@ export interface MlStartTrainedModelDeploymentResponse {

export interface MlStopDataFrameAnalyticsRequest extends RequestBase {
id: Id
allow_no_match?: boolean
force?: boolean
timeout?: Duration
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
body?: {
id?: Id
allow_no_match?: boolean
force?: boolean
timeout?: Duration
}
}

export interface MlStopDataFrameAnalyticsResponse {
Expand All @@ -18231,8 +18235,12 @@ export interface MlStopDatafeedResponse {

export interface MlStopTrainedModelDeploymentRequest extends RequestBase {
model_id: Id
allow_no_match?: boolean
force?: boolean
/** @deprecated The use of the 'body' key has been deprecated, move the nested keys to the top level object. */
body?: {
id?: Id
allow_no_match?: boolean
force?: boolean
}
}

export interface MlStopTrainedModelDeploymentResponse {
Expand Down Expand Up @@ -22538,6 +22546,26 @@ export interface TransformDeleteTransformRequest extends RequestBase {

export type TransformDeleteTransformResponse = AcknowledgedResponseBase

export interface TransformGetNodeStatsRequest extends RequestBase {
}

export type TransformGetNodeStatsResponse = TransformGetNodeStatsTransformNodeFullStats

export interface TransformGetNodeStatsTransformNodeFullStatsKeys {
total: TransformGetNodeStatsTransformNodeStats
}
export type TransformGetNodeStatsTransformNodeFullStats = TransformGetNodeStatsTransformNodeFullStatsKeys
& { [property: string]: TransformGetNodeStatsTransformNodeStats }

export interface TransformGetNodeStatsTransformNodeStats {
scheduler: TransformGetNodeStatsTransformSchedulerStats
}

export interface TransformGetNodeStatsTransformSchedulerStats {
registered_transform_count: integer
peek_transform?: string
}

export interface TransformGetTransformRequest extends RequestBase {
transform_id?: Names
allow_no_match?: boolean
Expand Down