Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
678 changes: 658 additions & 20 deletions output/schema/schema.json

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions output/typescript/types.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 64 additions & 0 deletions specification/indices/_types/SampleConfiguration.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { ByteSize } from '@_types/common'
import { double, integer, long } from '@_types/Numeric'
import { DateTime, Duration } from '@_types/Time'

/**
* Sampling configuration as returned by the API.
*/
export class SamplingConfiguration {
/**
* The fraction of documents to sample between 0 and 1.
*/
rate: double
/**
* The maximum number of documents to sample.
*/
max_samples: integer
/**
* The maximum total size of sampled documents.
*/
max_size?: ByteSize
/**
* The maximum total size of sampled documents in bytes.
*/
max_size_in_bytes: long
/**
* The duration for which the sampled documents should be retained.
*/
time_to_live?: Duration
/**
* The duration for which the sampled documents should be retained, in milliseconds.
*/
time_to_live_in_millis: long
/**
* An optional condition script that sampled documents must satisfy.
*/
if?: string
/**
* The time when the sampling configuration was created.
*/
creation_time?: DateTime
/**
* The time when the sampling configuration was created, in milliseconds since epoch.
*/
creation_time_in_millis: long
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { RequestBase } from '@_types/Base'
import { IndexName } from '@_types/common'
import { Duration } from '@_types/Time'

/**
* Delete sampling configuration.
* Delete the sampling configuration for the specified index.
* @rest_spec_name indices.delete_sample_configuration
* @availability stack visibility=feature_flag feature_flag=random_sampling since=9.3.0 stability=experimental
* @doc_id random_sample
* @doc_tag random_sample
*/
export interface Request extends RequestBase {
urls: [
{
path: '/{index}/_sample/config'
methods: ['DELETE']
}
]
path_parts: {
/**
* The name of the index.
*/
index: IndexName
}
query_parameters: {
/**
* 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.
* @server_default 30s
*/
master_timeout?: Duration
/**
* Period to wait for a response.
* If no response is received before the timeout expires, the request fails and returns an error.
* @server_default 30s
*/
timeout?: Duration
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { AcknowledgedResponseBase } from '@_types/Base'

export class Response {
/** @codegen_name result */
body: AcknowledgedResponseBase
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# summary: ''
description: A successful response for deleting a sampling configuration.
# type: response
# response_code: 200
value: |-
{
"acknowledged": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
method_request: DELETE /my-index/_sample/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { RequestBase } from '@_types/Base'
import { Duration } from '@_types/Time'

/**
* Get all sampling configurations.
* Get the sampling configurations for all indices.
* @rest_spec_name indices.get_all_sample_configuration
* @availability stack visibility=feature_flag feature_flag=random_sampling since=9.3.0 stability=experimental
* @doc_id random_sample
* @doc_tag random_sample
*/
export interface Request extends RequestBase {
urls: [
{
path: '/_sample/config'
methods: ['GET']
}
]
query_parameters: {
/**
* 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.
* @server_default 30s
*/
master_timeout?: Duration
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { IndexSamplingConfiguration } from './_types/IndexSamplingConfiguration'

export class Response {
body: {
configurations: IndexSamplingConfiguration[]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

import { IndexName } from '@_types/common'
import { SamplingConfiguration } from '@indices/_types/SampleConfiguration'

export class IndexSamplingConfiguration {
index: IndexName
configuration: SamplingConfiguration
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# summary: ''
description: A successful response for retrieving all sampling configurations.
# type: response
# response_code: 200
value: |-
{
"configurations": [
{
"index": "my-index",
"configuration": {
"rate": 0.05,
"max_samples": 1000,
"max_size_in_bytes": 10485760,
"time_to_live_in_millis": 86400000,
"if": "ctx?.network?.name == 'Guest'",
"creation_time_in_millis": 1761677431066
}
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
method_request: GET /_sample/config
Loading