Skip to content

Commit

Permalink
API generation
Browse files Browse the repository at this point in the history
  • Loading branch information
delvedor committed Sep 23, 2021
1 parent ef7e95a commit 3a3530e
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 36 deletions.
8 changes: 4 additions & 4 deletions api/api/nodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function NodesApi (transport, ConfigurationError) {
this[kConfigurationError] = ConfigurationError
}

NodesApi.prototype.clearMeteringArchive = function nodesClearMeteringArchiveApi (params, options, callback) {
NodesApi.prototype.clearRepositoriesMeteringArchive = function nodesClearRepositoriesMeteringArchiveApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)

// check required parameters
Expand Down Expand Up @@ -68,7 +68,7 @@ NodesApi.prototype.clearMeteringArchive = function nodesClearMeteringArchiveApi
return this.transport.request(request, options, callback)
}

NodesApi.prototype.getMeteringInfo = function nodesGetMeteringInfoApi (params, options, callback) {
NodesApi.prototype.getRepositoriesMeteringInfo = function nodesGetRepositoriesMeteringInfoApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)

// check required parameters
Expand Down Expand Up @@ -259,8 +259,8 @@ NodesApi.prototype.usage = function nodesUsageApi (params, options, callback) {
}

Object.defineProperties(NodesApi.prototype, {
clear_metering_archive: { get () { return this.clearMeteringArchive } },
get_metering_info: { get () { return this.getMeteringInfo } },
clear_repositories_metering_archive: { get () { return this.clearRepositoriesMeteringArchive } },
get_repositories_metering_info: { get () { return this.getRepositoriesMeteringInfo } },
hot_threads: { get () { return this.hotThreads } },
reload_secure_settings: { get () { return this.reloadSecureSettings } }
})
Expand Down
15 changes: 8 additions & 7 deletions api/api/open_point_in_time.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,18 @@ const snakeCase = { ignoreUnavailable: 'ignore_unavailable', expandWildcards: 'e
function openPointInTimeApi (params, options, callback) {
;[params, options, callback] = normalizeArguments(params, options, callback)

// check required parameters
if (params.index == null) {
const err = new this[kConfigurationError]('Missing required parameter: index')
return handleError(err, callback)
}

let { method, body, index, ...querystring } = params
querystring = snakeCaseKeys(acceptedQuerystring, snakeCase, querystring)

let path = ''
if ((index) != null) {
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_pit'
} else {
if (method == null) method = 'POST'
path = '/' + '_pit'
}
if (method == null) method = 'POST'
path = '/' + encodeURIComponent(index) + '/' + '_pit'

// build request object
const request = {
Expand Down
6 changes: 3 additions & 3 deletions api/requestParams.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2025,12 +2025,12 @@ export interface Mtermvectors<T = RequestBody> extends Generic {
body?: T;
}

export interface NodesClearMeteringArchive extends Generic {
export interface NodesClearRepositoriesMeteringArchive extends Generic {
node_id: string | string[];
max_archive_version: number;
}

export interface NodesGetMeteringInfo extends Generic {
export interface NodesGetRepositoriesMeteringInfo extends Generic {
node_id: string | string[];
}

Expand Down Expand Up @@ -2079,7 +2079,7 @@ export interface NodesUsage extends Generic {
}

export interface OpenPointInTime extends Generic {
index?: string | string[];
index: string | string[];
preference?: string;
routing?: string;
ignore_unavailable?: boolean;
Expand Down
12 changes: 6 additions & 6 deletions docs/reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4132,8 +4132,8 @@ link:{ref}/indices-delete-index.html[Documentation] +
|`boolean` - Ignore if a wildcard expression resolves to no concrete indices (default: false)

|`expand_wildcards` or `expandWildcards`
|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether wildcard expressions should get expanded to open or closed indices (default: open) +
_Default:_ `open`
|`'open' \| 'closed' \| 'hidden' \| 'none' \| 'all'` - Whether wildcard expressions should get expanded to open, closed, or hidden indices +
_Default:_ `open,closed`

|===

Expand Down Expand Up @@ -8369,11 +8369,11 @@ _Default:_ `true`
|===

[discrete]
=== nodes.clearMeteringArchive
=== nodes.clearRepositoriesMeteringArchive
*Stability:* experimental
[source,ts]
----
client.nodes.clearMeteringArchive({
client.nodes.clearRepositoriesMeteringArchive({
node_id: string | string[],
max_archive_version: number
})
Expand All @@ -8390,11 +8390,11 @@ link:{ref}/clear-repositories-metering-archive-api.html[Documentation] +
|===

[discrete]
=== nodes.getMeteringInfo
=== nodes.getRepositoriesMeteringInfo
*Stability:* experimental
[source,ts]
----
client.nodes.getMeteringInfo({
client.nodes.getRepositoriesMeteringInfo({
node_id: string | string[]
})
----
Expand Down
32 changes: 16 additions & 16 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1926,22 +1926,22 @@ declare class Client {
mtermvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Mtermvectors<TRequestBody>, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
mtermvectors<TResponse = Record<string, any>, TRequestBody extends RequestBody = Record<string, any>, TContext = Context>(params: RequestParams.Mtermvectors<TRequestBody>, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
nodes: {
clear_metering_archive<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesClearMeteringArchive, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
clear_metering_archive<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
clear_metering_archive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearMeteringArchive, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
clear_metering_archive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearMeteringArchive, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
clearMeteringArchive<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesClearMeteringArchive, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
clearMeteringArchive<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
clearMeteringArchive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearMeteringArchive, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
clearMeteringArchive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearMeteringArchive, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_metering_info<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesGetMeteringInfo, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get_metering_info<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_metering_info<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetMeteringInfo, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_metering_info<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetMeteringInfo, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getMeteringInfo<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesGetMeteringInfo, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getMeteringInfo<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getMeteringInfo<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetMeteringInfo, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getMeteringInfo<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetMeteringInfo, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
clear_repositories_metering_archive<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesClearRepositoriesMeteringArchive, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
clear_repositories_metering_archive<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
clear_repositories_metering_archive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearRepositoriesMeteringArchive, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
clear_repositories_metering_archive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearRepositoriesMeteringArchive, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
clearRepositoriesMeteringArchive<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesClearRepositoriesMeteringArchive, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
clearRepositoriesMeteringArchive<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
clearRepositoriesMeteringArchive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearRepositoriesMeteringArchive, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
clearRepositoriesMeteringArchive<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesClearRepositoriesMeteringArchive, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_repositories_metering_info<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesGetRepositoriesMeteringInfo, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
get_repositories_metering_info<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_repositories_metering_info<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetRepositoriesMeteringInfo, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
get_repositories_metering_info<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetRepositoriesMeteringInfo, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getRepositoriesMeteringInfo<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesGetRepositoriesMeteringInfo, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
getRepositoriesMeteringInfo<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getRepositoriesMeteringInfo<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetRepositoriesMeteringInfo, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
getRepositoriesMeteringInfo<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesGetRepositoriesMeteringInfo, options: TransportRequestOptions, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
hot_threads<TResponse = Record<string, any>, TContext = Context>(params?: RequestParams.NodesHotThreads, options?: TransportRequestOptions): TransportRequestPromise<ApiResponse<TResponse, TContext>>
hot_threads<TResponse = Record<string, any>, TContext = Context>(callback: callbackFn<TResponse, TContext>): TransportRequestCallback
hot_threads<TResponse = Record<string, any>, TContext = Context>(params: RequestParams.NodesHotThreads, callback: callbackFn<TResponse, TContext>): TransportRequestCallback
Expand Down

0 comments on commit 3a3530e

Please sign in to comment.