Skip to content

Commit

Permalink
Auto-generated API code
Browse files Browse the repository at this point in the history
  • Loading branch information
elasticmachine committed Nov 25, 2024
1 parent dbd0ec2 commit 4514261
Show file tree
Hide file tree
Showing 10 changed files with 161 additions and 95 deletions.
28 changes: 0 additions & 28 deletions docs/doc_examples/2577acb462b95bd4394523cf2f8a661f.asciidoc

This file was deleted.

16 changes: 0 additions & 16 deletions docs/doc_examples/2bb41b0b4876ce98cd0cd8fb6d337f18.asciidoc

This file was deleted.

10 changes: 0 additions & 10 deletions docs/doc_examples/4dab4c5168047ba596af1beb0e55b845.asciidoc

This file was deleted.

13 changes: 13 additions & 0 deletions docs/doc_examples/9313f534e1aa266cde7d4af74665497f.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.connector.put({
connector_id: "my-{service-name-stub}-connector",
index_name: "my-elasticsearch-index",
name: "Content synced from {service-name}",
service_type: "{service-name-stub}",
});
console.log(response);
----
14 changes: 14 additions & 0 deletions docs/doc_examples/ae3473adaf1515afcf7773f26c018e5c.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.connector.put({
connector_id: "my-{service-name-stub}-connector",
index_name: "my-elasticsearch-index",
name: "Content synced from {service-name}",
service_type: "{service-name-stub}",
is_native: true,
});
console.log(response);
----
11 changes: 0 additions & 11 deletions docs/doc_examples/d01a590fa9ea8a0cb34ed8dda502296c.asciidoc

This file was deleted.

16 changes: 16 additions & 0 deletions docs/doc_examples/e22a1da3c622611be6855e534c0709ae.asciidoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This file is autogenerated, DO NOT EDIT
// Use `node scripts/generate-docs-examples.js` to generate the docs examples

[source, js]
----
const response = await client.transport.request({
method: "POST",
path: "/_query_rules/my-ruleset/_test",
body: {
match_criteria: {
query_string: "puggles",
},
},
});
console.log(response);
----
24 changes: 20 additions & 4 deletions docs/reference.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -818,6 +818,8 @@ Random by default.
** *`expand_wildcards` (Optional, Enum("all" | "open" | "closed" | "hidden" | "none") | Enum("all" | "open" | "closed" | "hidden" | "none")[])*: Type of index that wildcard patterns can match.
If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams.
Supports a list of values, such as `open,hidden`. Valid values are: `all`, `open`, `closed`, `hidden`, `none`.
** *`allow_partial_search_results` (Optional, boolean)*: If `false`, creating a point in time request when a shard is missing or unavailable will throw an exception.
If `true`, the point in time will contain all the shards that are available at the time of the request.

[discrete]
=== ping
Expand Down Expand Up @@ -1690,6 +1692,9 @@ client.autoscaling.deleteAutoscalingPolicy({ name })

* *Request (object):*
** *`name` (string)*: the name of the autoscaling policy
** *`master_timeout` (Optional, string | -1 | 0)*: 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.
** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

[discrete]
==== get_autoscaling_capacity
Expand All @@ -1711,9 +1716,15 @@ Do not use this information to make autoscaling decisions.
{ref}/autoscaling-get-autoscaling-capacity.html[Endpoint documentation]
[source,ts]
----
client.autoscaling.getAutoscalingCapacity()
client.autoscaling.getAutoscalingCapacity({ ... })
----

[discrete]
==== Arguments

* *Request (object):*
** *`master_timeout` (Optional, string | -1 | 0)*: 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.

[discrete]
==== get_autoscaling_policy
Expand All @@ -1732,6 +1743,8 @@ client.autoscaling.getAutoscalingPolicy({ name })

* *Request (object):*
** *`name` (string)*: the name of the autoscaling policy
** *`master_timeout` (Optional, string | -1 | 0)*: 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.

[discrete]
==== put_autoscaling_policy
Expand All @@ -1751,6 +1764,9 @@ client.autoscaling.putAutoscalingPolicy({ name })
* *Request (object):*
** *`name` (string)*: the name of the autoscaling policy
** *`policy` (Optional, { roles, deciders })*
** *`master_timeout` (Optional, string | -1 | 0)*: 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.
** *`timeout` (Optional, string | -1 | 0)*: Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

[discrete]
=== cat
Expand Down Expand Up @@ -9204,7 +9220,7 @@ client.security.bulkPutRole({ roles })
==== Arguments

* *Request (object):*
** *`roles` (Record<string, { cluster, indices, remote_indices, remote_cluster, global, applications, metadata, run_as, description, transient_metadata }>)*: A dictionary of role name to RoleDescriptor objects to add or update
** *`roles` (Record<string, { cluster, indices, remote_indices, remote_cluster, global, applications, metadata, run_as, description, restriction, transient_metadata }>)*: A dictionary of role name to RoleDescriptor objects to add or update
** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.

[discrete]
Expand Down Expand Up @@ -9361,7 +9377,7 @@ client.security.createApiKey({ ... })
* *Request (object):*
** *`expiration` (Optional, string | -1 | 0)*: Expiration time for the API key. By default, API keys never expire.
** *`name` (Optional, string)*: Specifies the name for this API key.
** *`role_descriptors` (Optional, Record<string, { cluster, indices, remote_indices, remote_cluster, global, applications, metadata, run_as, description, transient_metadata }>)*: An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API.
** *`role_descriptors` (Optional, Record<string, { cluster, indices, remote_indices, remote_cluster, global, applications, metadata, run_as, description, restriction, transient_metadata }>)*: An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API.
** *`metadata` (Optional, Record<string, User-defined value>)*: Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with `_` are reserved for system usage.
** *`refresh` (Optional, Enum(true | false | "wait_for"))*: If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes.

Expand Down Expand Up @@ -10431,7 +10447,7 @@ client.security.updateApiKey({ id })

* *Request (object):*
** *`id` (string)*: The ID of the API key to update.
** *`role_descriptors` (Optional, Record<string, { cluster, indices, remote_indices, remote_cluster, global, applications, metadata, run_as, description, transient_metadata }>)*: An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API.
** *`role_descriptors` (Optional, Record<string, { cluster, indices, remote_indices, remote_cluster, global, applications, metadata, run_as, description, restriction, transient_metadata }>)*: An array of role descriptors for this API key. This parameter is optional. When it is not specified or is an empty array, then the API key will have a point in time snapshot of permissions of the authenticated user. If you supply role descriptors then the resultant permissions would be an intersection of API keys permissions and authenticated user’s permissions thereby limiting the access scope for API keys. The structure of role descriptor is the same as the request for create role API. For more details, see create or update roles API.
** *`metadata` (Optional, Record<string, User-defined value>)*: Arbitrary metadata that you want to associate with the API key. It supports nested data structure. Within the metadata object, keys beginning with _ are reserved for system usage.
** *`expiration` (Optional, string | -1 | 0)*: Expiration time for the API key.

Expand Down
62 changes: 49 additions & 13 deletions src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,15 @@ export interface HealthReportDiskIndicatorDetails {
nodes_with_unknown_disk_status: long
}

export interface HealthReportFileSettingsIndicator extends HealthReportBaseIndicator {
details?: HealthReportFileSettingsIndicatorDetails
}

export interface HealthReportFileSettingsIndicatorDetails {
failure_streak: long
most_recent_failure: string
}

export interface HealthReportIlmIndicator extends HealthReportBaseIndicator {
details?: HealthReportIlmIndicatorDetails
}
Expand Down Expand Up @@ -533,6 +542,7 @@ export interface HealthReportIndicators {
ilm?: HealthReportIlmIndicator
slm?: HealthReportSlmIndicator
shards_capacity?: HealthReportShardsCapacityIndicator
file_settings?: HealthReportFileSettingsIndicator
}

export interface HealthReportMasterIsStableIndicator extends HealthReportBaseIndicator {
Expand Down Expand Up @@ -884,6 +894,7 @@ export interface OpenPointInTimeRequest extends RequestBase {
preference?: string
routing?: Routing
expand_wildcards?: ExpandWildcards
allow_partial_search_results?: boolean
index_filter?: QueryDslQueryContainer
}

Expand Down Expand Up @@ -6751,6 +6762,8 @@ export interface AutoscalingAutoscalingPolicy {

export interface AutoscalingDeleteAutoscalingPolicyRequest extends RequestBase {
name: Name
master_timeout?: Duration
timeout?: Duration
}

export type AutoscalingDeleteAutoscalingPolicyResponse = AcknowledgedResponseBase
Expand Down Expand Up @@ -6783,6 +6796,7 @@ export interface AutoscalingGetAutoscalingCapacityAutoscalingResources {
}

export interface AutoscalingGetAutoscalingCapacityRequest extends RequestBase {
master_timeout?: Duration
}

export interface AutoscalingGetAutoscalingCapacityResponse {
Expand All @@ -6791,12 +6805,15 @@ export interface AutoscalingGetAutoscalingCapacityResponse {

export interface AutoscalingGetAutoscalingPolicyRequest extends RequestBase {
name: Name
master_timeout?: Duration
}

export type AutoscalingGetAutoscalingPolicyResponse = AutoscalingAutoscalingPolicy

export interface AutoscalingPutAutoscalingPolicyRequest extends RequestBase {
name: Name
master_timeout?: Duration
timeout?: Duration
policy?: AutoscalingAutoscalingPolicy
}

Expand Down Expand Up @@ -16870,6 +16887,7 @@ export interface QueryRulesListRulesetsQueryRulesetListItem {
ruleset_id: Id
rule_total_count: integer
rule_criteria_types_counts: Record<string, integer>
rule_type_counts: Record<string, integer>
}

export interface QueryRulesListRulesetsRequest extends RequestBase {
Expand Down Expand Up @@ -17267,21 +17285,26 @@ export interface SecurityAccess {
}

export interface SecurityApiKey {
creation?: long
expiration?: long
id: Id
invalidated?: boolean
name: Name
realm?: string
type: SecurityApiKeyType
creation: EpochTime<UnitMillis>
expiration?: EpochTime<UnitMillis>
invalidated: boolean
invalidation?: EpochTime<UnitMillis>
username: Username
realm: string
realm_type?: string
username?: Username
profile_uid?: string
metadata?: Metadata
metadata: Metadata
role_descriptors?: Record<string, SecurityRoleDescriptor>
limited_by?: Record<string, SecurityRoleDescriptor>[]
access?: SecurityAccess
profile_uid?: string
_sort?: SortResults
}

export type SecurityApiKeyType = 'rest' | 'cross_cluster'

export interface SecurityApplicationGlobalUserPrivileges {
manage: SecurityManageUserPrivileges
}
Expand Down Expand Up @@ -17328,7 +17351,7 @@ export type SecurityIndexPrivilege = 'all' | 'auto_configure' | 'create' | 'crea

export interface SecurityIndicesPrivileges {
field_security?: SecurityFieldSecurity
names: IndexName[]
names: IndexName | IndexName[]
privileges: SecurityIndexPrivilege[]
query?: SecurityIndicesPrivilegesQuery
allow_restricted_indices?: boolean
Expand All @@ -17355,17 +17378,23 @@ export interface SecurityRemoteClusterPrivileges {
export interface SecurityRemoteIndicesPrivileges {
clusters: Names
field_security?: SecurityFieldSecurity
names: IndexName[]
names: IndexName | IndexName[]
privileges: SecurityIndexPrivilege[]
query?: SecurityIndicesPrivilegesQuery
allow_restricted_indices?: boolean
}

export interface SecurityReplicationAccess {
names: IndexName[]
names: IndexName | IndexName[]
allow_restricted_indices?: boolean
}

export interface SecurityRestriction {
workflows: SecurityRestrictionWorkflow[]
}

export type SecurityRestrictionWorkflow = 'search_application_query' | string

export interface SecurityRoleDescriptor {
cluster?: SecurityClusterPrivilege[]
indices?: SecurityIndicesPrivileges[]
Expand All @@ -17377,6 +17406,7 @@ export interface SecurityRoleDescriptor {
metadata?: Metadata
run_as?: string[]
description?: string
restriction?: SecurityRestriction
transient_metadata?: Record<string, any>
}

Expand All @@ -17391,6 +17421,7 @@ export interface SecurityRoleDescriptorRead {
metadata?: Metadata
run_as?: string[]
description?: string
restriction?: SecurityRestriction
transient_metadata?: Record<string, any>
}

Expand Down Expand Up @@ -17430,7 +17461,7 @@ export interface SecurityRoleTemplateScript {

export interface SecuritySearchAccess {
field_security?: SecurityFieldSecurity
names: IndexName[]
names: IndexName | IndexName[]
query?: SecurityIndicesPrivilegesQuery
allow_restricted_indices?: boolean
}
Expand All @@ -17449,7 +17480,7 @@ export interface SecurityUser {

export interface SecurityUserIndicesPrivileges {
field_security?: SecurityFieldSecurity[]
names: IndexName[]
names: IndexName | IndexName[]
privileges: SecurityIndexPrivilege[]
query?: SecurityIndicesPrivilegesQuery[]
allow_restricted_indices: boolean
Expand Down Expand Up @@ -17493,11 +17524,16 @@ export interface SecurityActivateUserProfileRequest extends RequestBase {

export type SecurityActivateUserProfileResponse = SecurityUserProfileWithMetadata

export interface SecurityAuthenticateAuthenticateApiKey {
id: Id
name?: Name
}

export interface SecurityAuthenticateRequest extends RequestBase {
}

export interface SecurityAuthenticateResponse {
api_key?: SecurityApiKey
api_key?: SecurityAuthenticateAuthenticateApiKey
authentication_realm: SecurityRealmInfo
email?: string | null
full_name?: Name | null
Expand Down
Loading

0 comments on commit 4514261

Please sign in to comment.