From b383c7834d3809a3c2e19a712d49fa940979aad6 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Wed, 20 Aug 2025 16:57:56 +0400 Subject: [PATCH 01/26] Add initial rest-api-spec converter --- compiler-rs/Cargo.toml | 1 + .../.gitignore | 1 + .../Cargo.toml | 18 ++ .../src/lib.rs | 257 ++++++++++++++++++ .../src/main.rs | 57 ++++ .../src/spec.rs | 70 +++++ 6 files changed, 404 insertions(+) create mode 100644 compiler-rs/clients_schema_to_rest_api_spec/.gitignore create mode 100644 compiler-rs/clients_schema_to_rest_api_spec/Cargo.toml create mode 100644 compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs create mode 100644 compiler-rs/clients_schema_to_rest_api_spec/src/main.rs create mode 100644 compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs diff --git a/compiler-rs/Cargo.toml b/compiler-rs/Cargo.toml index 7644c40d1c..3b44cd67d8 100644 --- a/compiler-rs/Cargo.toml +++ b/compiler-rs/Cargo.toml @@ -4,6 +4,7 @@ members = [ "clients_schema", "openapi_to_clients_schema", "clients_schema_to_openapi", + "clients_schema_to_rest_api_spec", "compiler-wasm-lib", ] diff --git a/compiler-rs/clients_schema_to_rest_api_spec/.gitignore b/compiler-rs/clients_schema_to_rest_api_spec/.gitignore new file mode 100644 index 0000000000..3c8e52e2b9 --- /dev/null +++ b/compiler-rs/clients_schema_to_rest_api_spec/.gitignore @@ -0,0 +1 @@ +rest-api-output diff --git a/compiler-rs/clients_schema_to_rest_api_spec/Cargo.toml b/compiler-rs/clients_schema_to_rest_api_spec/Cargo.toml new file mode 100644 index 0000000000..8013e0528a --- /dev/null +++ b/compiler-rs/clients_schema_to_rest_api_spec/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "clients_schema_to_rest_api_spec" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +clients_schema = { path = "../clients_schema" } + +argh = { workspace = true } +serde = { workspace = true, features = ["derive"] } +serde_json = { workspace = true } +anyhow = { workspace = true } +indexmap = { workspace = true } +itertools = { workspace = true } + +tracing = { workspace = true } +tracing-subscriber = { workspace = true } diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs new file mode 100644 index 0000000000..3175e785da --- /dev/null +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -0,0 +1,257 @@ +use anyhow::Result; +use clients_schema::{ + IndexedModel, Endpoint as SchemaEndpoint, TypeDefinition, ValueOf, Property, + UrlTemplate, TypeName, Body as SchemaBody +}; +use indexmap::IndexMap; +use std::collections::HashMap; +use std::fs::File; +use std::io::BufWriter; +use std::path::Path as StdPath; + +pub mod spec; + +pub use spec::*; + + +/// Convert a clients_schema IndexedModel to individual rest-api-spec files +pub fn convert_schema_to_individual_files(model: IndexedModel, output_dir: &str) -> Result<()> { + // Expand generics in the model first + let expanded_model = clients_schema::transform::expand_generics( + model, + clients_schema::transform::ExpandConfig::default() + )?; + + for endpoint in expanded_model.endpoints { + let converted_endpoint = convert_endpoint(&endpoint, &expanded_model.types)?; + + // Create filename from endpoint name + let filename = format!("{}.json", endpoint.name); + let file_path = StdPath::new(output_dir).join(&filename); + + // Write individual endpoint file + let output_file = File::create(&file_path)?; + let writer = BufWriter::new(output_file); + serde_json::to_writer_pretty(writer, &converted_endpoint)?; + + tracing::debug!("Wrote {} to {}", endpoint.name, file_path.display()); + } + + Ok(()) +} + +/// Convert a single endpoint from clients_schema to rest-api-spec format +fn convert_endpoint( + endpoint: &SchemaEndpoint, + types: &IndexMap +) -> Result { + // Extract documentation + let documentation = Documentation { + url: endpoint.doc_url.clone().unwrap_or_default(), + description: if endpoint.description.is_empty() { + None + } else { + Some(endpoint.description.clone()) + }, + }; + + // Convert stability information + let stability = endpoint.availability.as_ref().map(|_| "stable".to_string()); + + // Convert URL patterns + let paths = endpoint.urls.iter() + .map(|url_template| convert_url_template(url_template, endpoint, types)) + .collect::>>()?; + + let url = Url { paths }; + + // Extract parameters from the request type + let mut params = IndexMap::new(); + let mut body = None; + + if let Some(request_type_name) = &endpoint.request { + if let Some(TypeDefinition::Request(request)) = types.get(request_type_name) { + // Convert query parameters + for param in &request.query { + let converted_param = convert_parameter(param, types)?; + params.insert(param.name.clone(), converted_param); + } + + // Convert body if present + if !matches!(request.body, SchemaBody::NoBody(_)) { + body = Some(Body { + description: "Request body".to_string(), + }); + } + } + } + + // Convert deprecation information + let deprecated = endpoint.deprecation.as_ref().map(|dep| Deprecation { + version: dep.version.clone(), + description: dep.description.clone(), + }); + + Ok(Endpoint { + documentation, + stability, + url, + params, + body, + deprecated, + }) +} + +/// Convert a URL template to a Path +fn convert_url_template( + url_template: &UrlTemplate, + endpoint: &SchemaEndpoint, + types: &IndexMap +) -> Result { + let mut parts = HashMap::new(); + + // Extract path parameters from the request type + if let Some(request_type_name) = &endpoint.request { + if let Some(TypeDefinition::Request(request)) = types.get(request_type_name) { + for path_param in &request.path { + let part = PathPart { + typ: get_type_name(&path_param.typ, types), + description: path_param.description.clone().unwrap_or_default(), + deprecated: path_param.deprecation.as_ref().map(|dep| Deprecation { + version: dep.version.clone(), + description: dep.description.clone(), + }), + }; + parts.insert(path_param.name.clone(), part); + } + } + } + + Ok(Path { + path: url_template.path.clone(), + methods: url_template.methods.clone(), + parts, + }) +} + +/// Convert a Property to a Parameter +fn convert_parameter( + property: &Property, + types: &IndexMap +) -> Result { + let typ = get_type_name(&property.typ, types); + let options = get_enum_options(&property.typ, types); + + let default = property.server_default.as_ref().map(|default| { + match default { + clients_schema::ServerDefault::String(s) => s.clone(), + clients_schema::ServerDefault::Number(n) => n.to_string(), + clients_schema::ServerDefault::Boolean(b) => b.to_string(), + clients_schema::ServerDefault::StringArray(arr) => format!("{:?}", arr), + clients_schema::ServerDefault::NumberArray(arr) => format!("{:?}", arr), + } + }); + + let deprecated = property.deprecation.as_ref().map(|dep| Deprecation { + version: dep.version.clone(), + description: dep.description.clone(), + }); + + Ok(Parameter { + typ, + description: property.description.clone().unwrap_or_default(), + options, + default, + deprecated, + }) +} + +/// Convert a ValueOf type to a simple string representation +fn get_type_name(value_of: &ValueOf, types: &IndexMap) -> String { + match value_of { + ValueOf::InstanceOf(instance) => { + // Handle builtin types + let type_name = &instance.typ; + match (type_name.namespace.as_str(), type_name.name.as_str()) { + ("_builtins", "string") => "string".to_string(), + ("_builtins", "boolean") => "boolean".to_string(), + ("_builtins", "number") => "number".to_string(), + ("_builtins", "integer") => "int".to_string(), + ("_builtins", "long") => "long".to_string(), + ("_builtins", "float") => "float".to_string(), + ("_builtins", "double") => "double".to_string(), + ("_builtins", "byte") => "byte".to_string(), + ("_builtins", "short") => "short".to_string(), + ("_builtins", "DateTime") => "time".to_string(), + ("_builtins", "Duration") => "time".to_string(), + _ => { + // Check if it's an enum type + if let Some(TypeDefinition::Enum(_)) = types.get(type_name) { + "enum".to_string() + } else { + "string".to_string() // Default fallback + } + } + } + } + ValueOf::ArrayOf(_) => "list".to_string(), + ValueOf::UnionOf(_) => "object".to_string(), // Fallback for complex unions + ValueOf::DictionaryOf(_) => "object".to_string(), + ValueOf::UserDefinedValue(_) => "object".to_string(), + ValueOf::LiteralValue(_) => "string".to_string(), + } +} + +/// Extract enum options from a ValueOf type +fn get_enum_options(value_of: &ValueOf, types: &IndexMap) -> Vec { + match value_of { + ValueOf::InstanceOf(instance) => { + if let Some(TypeDefinition::Enum(enum_def)) = types.get(&instance.typ) { + enum_def.members.iter() + .map(|member| member.name.clone()) + .collect() + } else { + vec![] + } + } + ValueOf::UnionOf(union) => { + // For union types, collect all literal values as options + union.items.iter() + .filter_map(|item| match item { + ValueOf::LiteralValue(literal) => { + Some(literal.value.to_string()) + } + _ => None, + }) + .collect() + } + _ => vec![], + } +} + +#[cfg(test)] +mod tests { + use super::*; + use clients_schema::*; + + #[test] + fn test_get_type_name_builtin_types() { + let types = IndexMap::new(); + + // Test string type + let string_type = ValueOf::InstanceOf(InstanceOf { + typ: TypeName { + namespace: "_builtins".into(), + name: "string".into(), + }, + generics: vec![], + }); + assert_eq!(get_type_name(&string_type, &types), "string"); + + // Test array type + let array_type = ValueOf::ArrayOf(ArrayOf { + value: Box::new(string_type), + }); + assert_eq!(get_type_name(&array_type, &types), "list"); + } +} \ No newline at end of file diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/main.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/main.rs new file mode 100644 index 0000000000..cc5ba7273c --- /dev/null +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/main.rs @@ -0,0 +1,57 @@ +use std::fs::{File, create_dir_all}; +use clients_schema::IndexedModel; +use clients_schema_to_rest_api_spec::convert_schema_to_individual_files; +use tracing::Level; +use tracing_subscriber::fmt::format::FmtSpan; +use tracing_subscriber::FmtSubscriber; +use argh::FromArgs; + +#[derive(FromArgs)] +/// Convert clients_schema format to rest-api-spec format +struct Cli { + /// path to the input schema.json file + #[argh(option, short = 'i')] + input: String, + + /// path to the output directory for individual API files + #[argh(option, short = 'o')] + output_dir: String, + + /// enable verbose logging + #[argh(switch, short = 'v')] + verbose: bool, +} + +fn main() -> anyhow::Result<()> { + let cli: Cli = argh::from_env(); + + // Set up logging + let level = if cli.verbose { Level::DEBUG } else { Level::INFO }; + let subscriber = FmtSubscriber::builder() + .with_writer(std::io::stderr) + .with_max_level(level) + .with_span_events(FmtSpan::NEW | FmtSpan::CLOSE) + .finish(); + + tracing::subscriber::set_global_default(subscriber)?; + + tracing::info!("Reading schema from {}", cli.input); + + // Read and parse the input schema + let input_file = File::open(&cli.input)?; + let indexed_model: IndexedModel = serde_json::from_reader(input_file)?; + + tracing::info!("Converting schema to rest-api-spec format"); + + // Create output directory if it doesn't exist + create_dir_all(&cli.output_dir)?; + + // Convert the schema to individual files + convert_schema_to_individual_files(indexed_model, &cli.output_dir)?; + + tracing::info!("Writing individual API files to {}", cli.output_dir); + + tracing::info!("Conversion completed successfully"); + + Ok(()) +} diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs new file mode 100644 index 0000000000..ecf8d200ca --- /dev/null +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs @@ -0,0 +1,70 @@ +use std::collections::HashMap; +use serde::Serialize; +use indexmap::IndexMap; + +#[derive(Debug, Serialize)] +pub struct Endpoint { + pub documentation: Documentation, + #[serde(skip_serializing_if = "Option::is_none")] + pub stability: Option, + pub url: Url, + #[serde(skip_serializing_if = "IndexMap::is_empty")] + pub params: IndexMap, + #[serde(skip_serializing_if = "Option::is_none")] + pub body: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub deprecated: Option, +} + +#[derive(Debug, Serialize)] +pub struct Documentation { + pub url: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, +} + +#[derive(Debug, Serialize)] +pub struct Url { + pub paths: Vec, +} + +#[derive(Debug, Serialize)] +pub struct Path { + pub path: String, + pub methods: Vec, + #[serde(skip_serializing_if = "HashMap::is_empty")] + pub parts: HashMap, +} + +#[derive(Debug, Serialize)] +pub struct PathPart { + #[serde(rename = "type")] + pub typ: String, + pub description: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub deprecated: Option, +} + +#[derive(Debug, Serialize)] +pub struct Parameter { + #[serde(rename = "type")] + pub typ: String, + pub description: String, + #[serde(skip_serializing_if = "Vec::is_empty")] + pub options: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub default: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub deprecated: Option, +} + +#[derive(Debug, Serialize)] +pub struct Body { + pub description: String, +} + +#[derive(Debug, Serialize)] +pub struct Deprecation { + pub version: String, + pub description: String, +} \ No newline at end of file From a21366a9b74587bfa730a4ce65bf86b7b675b65a Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 22 Aug 2025 16:41:33 +0400 Subject: [PATCH 02/26] Wrap JSON data with endpoint name --- compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index 3175e785da..1a6ea7bf83 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -25,6 +25,9 @@ pub fn convert_schema_to_individual_files(model: IndexedModel, output_dir: &str) for endpoint in expanded_model.endpoints { let converted_endpoint = convert_endpoint(&endpoint, &expanded_model.types)?; + // Wrap the JSON content with the API name + let wrapped_content = HashMap::from([(endpoint.name.clone(), converted_endpoint)]); + // Create filename from endpoint name let filename = format!("{}.json", endpoint.name); let file_path = StdPath::new(output_dir).join(&filename); @@ -32,7 +35,7 @@ pub fn convert_schema_to_individual_files(model: IndexedModel, output_dir: &str) // Write individual endpoint file let output_file = File::create(&file_path)?; let writer = BufWriter::new(output_file); - serde_json::to_writer_pretty(writer, &converted_endpoint)?; + serde_json::to_writer_pretty(writer, &wrapped_content)?; tracing::debug!("Wrote {} to {}", endpoint.name, file_path.display()); } From ec3a1f6fb265a4d21b690118d996dfbee2eb0f66 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 22 Aug 2025 16:41:57 +0400 Subject: [PATCH 03/26] Add headers --- .../src/lib.rs | 19 +++++++++++++++++++ .../src/spec.rs | 8 ++++++++ 2 files changed, 27 insertions(+) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index 1a6ea7bf83..622e80ca5d 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -94,10 +94,29 @@ fn convert_endpoint( version: dep.version.clone(), description: dep.description.clone(), }); + + // Convert headers from request_media_type and response_media_type + let headers = if !endpoint.request_media_type.is_empty() || !endpoint.response_media_type.is_empty() { + Some(Headers { + accept: if endpoint.response_media_type.is_empty() { + vec!["application/json".to_string()] + } else { + endpoint.response_media_type.clone() + }, + content_type: if endpoint.request_media_type.is_empty() { + vec!["application/json".to_string()] + } else { + endpoint.request_media_type.clone() + }, + }) + } else { + None + }; Ok(Endpoint { documentation, stability, + headers, url, params, body, diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs index ecf8d200ca..a5586532ed 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs @@ -7,6 +7,8 @@ pub struct Endpoint { pub documentation: Documentation, #[serde(skip_serializing_if = "Option::is_none")] pub stability: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub headers: Option, pub url: Url, #[serde(skip_serializing_if = "IndexMap::is_empty")] pub params: IndexMap, @@ -67,4 +69,10 @@ pub struct Body { pub struct Deprecation { pub version: String, pub description: String, +} + +#[derive(Debug, Serialize)] +pub struct Headers { + pub accept: Vec, + pub content_type: Vec, } \ No newline at end of file From ef0ddb11cb1736a26b3abb632bf21e5d3df17a07 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 25 Aug 2025 10:43:01 +0400 Subject: [PATCH 04/26] Extract visibility --- .../src/lib.rs | 38 ++++++++++++++++++- .../src/spec.rs | 2 + 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index 622e80ca5d..55d35dacbc 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -1,7 +1,7 @@ use anyhow::Result; use clients_schema::{ IndexedModel, Endpoint as SchemaEndpoint, TypeDefinition, ValueOf, Property, - UrlTemplate, TypeName, Body as SchemaBody + UrlTemplate, TypeName, Body as SchemaBody, Flavor, Visibility }; use indexmap::IndexMap; use std::collections::HashMap; @@ -61,6 +61,9 @@ fn convert_endpoint( // Convert stability information let stability = endpoint.availability.as_ref().map(|_| "stable".to_string()); + // Convert visibility information + let visibility = extract_visibility_from_availabilities(&endpoint.availability); + // Convert URL patterns let paths = endpoint.urls.iter() .map(|url_template| convert_url_template(url_template, endpoint, types)) @@ -116,6 +119,7 @@ fn convert_endpoint( Ok(Endpoint { documentation, stability, + visibility, headers, url, params, @@ -251,6 +255,38 @@ fn get_enum_options(value_of: &ValueOf, types: &IndexMap) -> Option { + if let Some(avails) = availabilities { + // Check for stack flavor first, then serverless, then default to the first available + let flavor = Flavor::Stack; + if let Some(visibility) = flavor.visibility(availabilities) { + Some(match visibility { + Visibility::Public => "public".to_string(), + Visibility::FeatureFlag => "feature_flag".to_string(), + Visibility::Private => "private".to_string(), + }) + } else { + // If stack flavor is not available, try other flavors + for (_, availability) in avails { + if let Some(ref vis) = availability.visibility { + return Some(match vis { + Visibility::Public => "public".to_string(), + Visibility::FeatureFlag => "feature_flag".to_string(), + Visibility::Private => "private".to_string(), + }); + } + } + // Default to public if no visibility is explicitly set + Some("public".to_string()) + } + } else { + // No availability restrictions means public + Some("public".to_string()) + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs index a5586532ed..ab018aab3d 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs @@ -8,6 +8,8 @@ pub struct Endpoint { #[serde(skip_serializing_if = "Option::is_none")] pub stability: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub visibility: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub headers: Option, pub url: Url, #[serde(skip_serializing_if = "IndexMap::is_empty")] From 3ec483a5883dbcf0d9c839f4e08847bf45b32b19 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 25 Aug 2025 11:34:39 +0400 Subject: [PATCH 05/26] Add debug logging for types --- .../src/lib.rs | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index 55d35dacbc..bbe15d1fbb 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -79,7 +79,7 @@ fn convert_endpoint( if let Some(TypeDefinition::Request(request)) = types.get(request_type_name) { // Convert query parameters for param in &request.query { - let converted_param = convert_parameter(param, types)?; + let converted_param = convert_parameter(param, types, &endpoint.name)?; params.insert(param.name.clone(), converted_param); } @@ -141,7 +141,7 @@ fn convert_url_template( if let Some(TypeDefinition::Request(request)) = types.get(request_type_name) { for path_param in &request.path { let part = PathPart { - typ: get_type_name(&path_param.typ, types), + typ: get_type_name(&path_param.typ, types, &endpoint.name, &path_param.name), description: path_param.description.clone().unwrap_or_default(), deprecated: path_param.deprecation.as_ref().map(|dep| Deprecation { version: dep.version.clone(), @@ -163,7 +163,8 @@ fn convert_url_template( /// Convert a Property to a Parameter fn convert_parameter( property: &Property, - types: &IndexMap + types: &IndexMap, + api_name: &str ) -> Result { let typ = get_type_name(&property.typ, types); let options = get_enum_options(&property.typ, types); @@ -193,7 +194,12 @@ fn convert_parameter( } /// Convert a ValueOf type to a simple string representation -fn get_type_name(value_of: &ValueOf, types: &IndexMap) -> String { +fn get_type_name( + value_of: &ValueOf, + types: &IndexMap, + api_name: &str, + parameter_name: &str +) -> String { match value_of { ValueOf::InstanceOf(instance) => { // Handle builtin types @@ -215,7 +221,9 @@ fn get_type_name(value_of: &ValueOf, types: &IndexMap) if let Some(TypeDefinition::Enum(_)) = types.get(type_name) { "enum".to_string() } else { - "string".to_string() // Default fallback + // Enhanced logging with context + tracing::warn!("{}:{} -> '{}'", api_name, parameter_name, type_name); + "???".to_string() // Default fallback } } } @@ -304,12 +312,29 @@ mod tests { }, generics: vec![], }); - assert_eq!(get_type_name(&string_type, &types), "string"); + assert_eq!(get_type_name(&string_type, &types, "test_api", "test_param"), "string"); // Test array type let array_type = ValueOf::ArrayOf(ArrayOf { value: Box::new(string_type), }); - assert_eq!(get_type_name(&array_type, &types), "list"); + assert_eq!(get_type_name(&array_type, &types, "test_api", "test_param"), "list"); + } + + #[test] + fn test_get_type_name_unknown_type_logging() { + let types = IndexMap::new(); + + // Test unknown type (should trigger the enhanced logging and return "string") + let unknown_type = ValueOf::InstanceOf(InstanceOf { + typ: TypeName { + namespace: "some_namespace".into(), + name: "UnknownType".into(), + }, + generics: vec![], + }); + + // This should log a warning with API and parameter context + assert_eq!(get_type_name(&unknown_type, &types, "search_api", "query_param"), "???"); } } \ No newline at end of file From f1fc167260a8564b3d4ff72f67d80a7227adbf23 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 25 Aug 2025 11:35:30 +0400 Subject: [PATCH 06/26] Improve type handling --- .../src/lib.rs | 49 ++++++++++++------- .../src/spec.rs | 2 +- 2 files changed, 33 insertions(+), 18 deletions(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index bbe15d1fbb..005b1c6693 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -166,19 +166,35 @@ fn convert_parameter( types: &IndexMap, api_name: &str ) -> Result { - let typ = get_type_name(&property.typ, types); - let options = get_enum_options(&property.typ, types); + let typ = get_type_name(&property.typ, types, api_name, &property.name); + let mut options = get_enum_options(&property.typ, types); - let default = property.server_default.as_ref().map(|default| { + let mut default = property.server_default.as_ref().map(|default| { match default { - clients_schema::ServerDefault::String(s) => s.clone(), - clients_schema::ServerDefault::Number(n) => n.to_string(), - clients_schema::ServerDefault::Boolean(b) => b.to_string(), - clients_schema::ServerDefault::StringArray(arr) => format!("{:?}", arr), - clients_schema::ServerDefault::NumberArray(arr) => format!("{:?}", arr), + clients_schema::ServerDefault::String(s) => serde_json::Value::String(s.clone()), + clients_schema::ServerDefault::Number(n) => serde_json::Value::from(*n as i64), + clients_schema::ServerDefault::Boolean(b) => serde_json::Value::Bool(*b), + clients_schema::ServerDefault::StringArray(arr) => { + serde_json::Value::Array(arr.iter().map(|s| serde_json::Value::String(s.clone())).collect()) + }, + clients_schema::ServerDefault::NumberArray(arr) => { + serde_json::Value::Array(arr.iter().map(|s| serde_json::Value::String(s.clone())).collect()) + }, } }); + // Hardcode expand_wildcards parameter + if property.name == "expand_wildcards" { + options = vec![ + "open".to_string(), + "closed".to_string(), + "hidden".to_string(), + "none".to_string(), + "all".to_string() + ]; + default = Some(serde_json::Value::String("open".to_string())); + } + let deprecated = property.deprecation.as_ref().map(|dep| Deprecation { version: dep.version.clone(), description: dep.description.clone(), @@ -207,15 +223,14 @@ fn get_type_name( match (type_name.namespace.as_str(), type_name.name.as_str()) { ("_builtins", "string") => "string".to_string(), ("_builtins", "boolean") => "boolean".to_string(), - ("_builtins", "number") => "number".to_string(), - ("_builtins", "integer") => "int".to_string(), - ("_builtins", "long") => "long".to_string(), - ("_builtins", "float") => "float".to_string(), - ("_builtins", "double") => "double".to_string(), - ("_builtins", "byte") => "byte".to_string(), - ("_builtins", "short") => "short".to_string(), - ("_builtins", "DateTime") => "time".to_string(), - ("_builtins", "Duration") => "time".to_string(), + ("_types", "integer") => "number".to_string(), + ("_types", "long") => "number".to_string(), + ("_types", "time") => "time".to_string(), + ("_types", "Duration") => "time".to_string(), + ("_global.search._types", "SourceConfigParam") => "list".to_string(), + ("_types", "Fields") => "list".to_string(), + ("_types", "Id") => "string".to_string(), + ("_types", "ExpandWildcard") => "enum".to_string(), _ => { // Check if it's an enum type if let Some(TypeDefinition::Enum(_)) = types.get(type_name) { diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs index ab018aab3d..cded274a14 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs @@ -57,7 +57,7 @@ pub struct Parameter { #[serde(skip_serializing_if = "Vec::is_empty")] pub options: Vec, #[serde(skip_serializing_if = "Option::is_none")] - pub default: Option, + pub default: Option, #[serde(skip_serializing_if = "Option::is_none")] pub deprecated: Option, } From 10dd1c61f4b1ec660d8dca9ad363c2baa52318ca Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 25 Aug 2025 11:43:56 +0400 Subject: [PATCH 07/26] Extract builting mappings --- .../src/lib.rs | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index 005b1c6693..4feb0b3c33 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -141,7 +141,7 @@ fn convert_url_template( if let Some(TypeDefinition::Request(request)) = types.get(request_type_name) { for path_param in &request.path { let part = PathPart { - typ: get_type_name(&path_param.typ, types, &endpoint.name, &path_param.name), + typ: get_type_name(&path_param.typ, types, &endpoint.name, &path_param.name).to_string(), description: path_param.description.clone().unwrap_or_default(), deprecated: path_param.deprecation.as_ref().map(|dep| Deprecation { version: dep.version.clone(), @@ -166,7 +166,7 @@ fn convert_parameter( types: &IndexMap, api_name: &str ) -> Result { - let typ = get_type_name(&property.typ, types, api_name, &property.name); + let typ = get_type_name(&property.typ, types, api_name, &property.name).to_string(); let mut options = get_enum_options(&property.typ, types); let mut default = property.server_default.as_ref().map(|default| { @@ -209,45 +209,46 @@ fn convert_parameter( }) } +const BUILTIN_MAPPINGS: &[((&str, &str), &str)] = &[ + (("_builtins", "string"), "string"), + (("_builtins", "boolean"), "boolean"), + (("_types", "integer"), "number"), + (("_types", "long"), "number"), + (("_types", "time"), "time"), + (("_types", "Duration"), "time"), + (("_global.search._types", "SourceConfigParam"), "list"), + (("_types", "Fields"), "list"), + (("_types", "Id"), "string"), + (("_types", "ExpandWildcard"), "enum"), + (("_types", "Indices"), "list"), +]; + /// Convert a ValueOf type to a simple string representation fn get_type_name( value_of: &ValueOf, types: &IndexMap, api_name: &str, parameter_name: &str -) -> String { +) -> &'static str { match value_of { ValueOf::InstanceOf(instance) => { - // Handle builtin types let type_name = &instance.typ; - match (type_name.namespace.as_str(), type_name.name.as_str()) { - ("_builtins", "string") => "string".to_string(), - ("_builtins", "boolean") => "boolean".to_string(), - ("_types", "integer") => "number".to_string(), - ("_types", "long") => "number".to_string(), - ("_types", "time") => "time".to_string(), - ("_types", "Duration") => "time".to_string(), - ("_global.search._types", "SourceConfigParam") => "list".to_string(), - ("_types", "Fields") => "list".to_string(), - ("_types", "Id") => "string".to_string(), - ("_types", "ExpandWildcard") => "enum".to_string(), - _ => { - // Check if it's an enum type - if let Some(TypeDefinition::Enum(_)) = types.get(type_name) { - "enum".to_string() - } else { - // Enhanced logging with context - tracing::warn!("{}:{} -> '{}'", api_name, parameter_name, type_name); - "???".to_string() // Default fallback - } - } + let key = (type_name.namespace.as_str(), type_name.name.as_str()); + + if let Some(&mapped_type) = BUILTIN_MAPPINGS.iter().find(|&&(k, _)| k == key).map(|(_, v)| v) { + mapped_type + } else if let Some(TypeDefinition::Enum(_)) = types.get(type_name) { + "enum" + } else { + tracing::warn!("{}:{} -> '{}'", api_name, parameter_name, type_name); + "???" } } - ValueOf::ArrayOf(_) => "list".to_string(), - ValueOf::UnionOf(_) => "object".to_string(), // Fallback for complex unions - ValueOf::DictionaryOf(_) => "object".to_string(), - ValueOf::UserDefinedValue(_) => "object".to_string(), - ValueOf::LiteralValue(_) => "string".to_string(), + ValueOf::ArrayOf(_) => "list", + ValueOf::UnionOf(_) => "object", + ValueOf::DictionaryOf(_) => "object", + ValueOf::UserDefinedValue(_) => "object", + ValueOf::LiteralValue(_) => "string", } } From 8181cbf47e8e5092d387c7842ac36a55185eee68 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 25 Aug 2025 15:52:06 +0400 Subject: [PATCH 08/26] Skip empty headers --- .../clients_schema_to_rest_api_spec/src/lib.rs | 12 ++---------- .../clients_schema_to_rest_api_spec/src/spec.rs | 2 ++ 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index 4feb0b3c33..cb0d491560 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -101,16 +101,8 @@ fn convert_endpoint( // Convert headers from request_media_type and response_media_type let headers = if !endpoint.request_media_type.is_empty() || !endpoint.response_media_type.is_empty() { Some(Headers { - accept: if endpoint.response_media_type.is_empty() { - vec!["application/json".to_string()] - } else { - endpoint.response_media_type.clone() - }, - content_type: if endpoint.request_media_type.is_empty() { - vec!["application/json".to_string()] - } else { - endpoint.request_media_type.clone() - }, + accept: endpoint.response_media_type.clone(), + content_type: endpoint.request_media_type.clone(), }) } else { None diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs index cded274a14..28bb5598f6 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs @@ -75,6 +75,8 @@ pub struct Deprecation { #[derive(Debug, Serialize)] pub struct Headers { + #[serde(skip_serializing_if = "Vec::is_empty")] pub accept: Vec, + #[serde(skip_serializing_if = "Vec::is_empty")] pub content_type: Vec, } \ No newline at end of file From 53a3c553b258bc900b83b6c4c81287344ecd209c Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 25 Aug 2025 15:52:27 +0400 Subject: [PATCH 09/26] Add more mappings --- compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index cb0d491560..829d376b6e 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -209,10 +209,17 @@ const BUILTIN_MAPPINGS: &[((&str, &str), &str)] = &[ (("_types", "time"), "time"), (("_types", "Duration"), "time"), (("_global.search._types", "SourceConfigParam"), "list"), + (("_types", "Field"), "string"), (("_types", "Fields"), "list"), + (("_types", "Name"), "string"), + (("_types", "Names"), "list"), (("_types", "Id"), "string"), - (("_types", "ExpandWildcard"), "enum"), + (("_types", "ExpandWildcards"), "enum"), (("_types", "Indices"), "list"), + // sometimes list in rest-api-spec as comma-separate values are allowed + // but the Elasticsearch specification always models it as a string. + (("_types", "Routing"), "string"), + (("_global.search._types", "TrackHits"), "boolean|long"), ]; /// Convert a ValueOf type to a simple string representation From 313e20352ddeee9b155e063c41ae12835d2dfa81 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 25 Aug 2025 16:36:15 +0400 Subject: [PATCH 10/26] Add required field to bodies --- .../src/lib.rs | 22 +++++++++++++++++++ .../src/spec.rs | 1 + 2 files changed, 23 insertions(+) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index 829d376b6e..7f962546cf 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -87,6 +87,7 @@ fn convert_endpoint( if !matches!(request.body, SchemaBody::NoBody(_)) { body = Some(Body { description: "Request body".to_string(), + required: endpoint.request_body_required, }); } } @@ -352,4 +353,25 @@ mod tests { // This should log a warning with API and parameter context assert_eq!(get_type_name(&unknown_type, &types, "search_api", "query_param"), "???"); } + + #[test] + fn test_body_struct_has_required_field() { + use crate::spec::Body; + + // Simple test to verify Body struct has required field + let body = Body { + description: "Test body".to_string(), + required: true, + }; + + assert_eq!(body.description, "Test body"); + assert_eq!(body.required, true); + + let body_optional = Body { + description: "Optional body".to_string(), + required: false, + }; + + assert_eq!(body_optional.required, false); + } } \ No newline at end of file diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs index 28bb5598f6..b9bed62bc5 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs @@ -65,6 +65,7 @@ pub struct Parameter { #[derive(Debug, Serialize)] pub struct Body { pub description: String, + pub required: bool, } #[derive(Debug, Serialize)] From e6c5ff01b0ccdfa35e803abe682e21d616ae97cb Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 26 Aug 2025 11:19:51 +0400 Subject: [PATCH 11/26] Support CommonCatQueryParameters --- .../src/lib.rs | 39 +++++++++++++++++-- 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index 7f962546cf..2b94b72462 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -83,6 +83,13 @@ fn convert_endpoint( params.insert(param.name.clone(), converted_param); } + // Add parameters from attached behaviors + for behavior_name in &request.attached_behaviors { + if behavior_name != "CommonQueryParameters" { // handled in _common.json + add_behavior_parameters(&mut params, behavior_name, types, &endpoint.name)?; + } + } + // Convert body if present if !matches!(request.body, SchemaBody::NoBody(_)) { body = Some(Body { @@ -209,17 +216,20 @@ const BUILTIN_MAPPINGS: &[((&str, &str), &str)] = &[ (("_types", "long"), "number"), (("_types", "time"), "time"), (("_types", "Duration"), "time"), - (("_global.search._types", "SourceConfigParam"), "list"), + (("_types", "ExpandWildcards"), "enum"), (("_types", "Field"), "string"), (("_types", "Fields"), "list"), - (("_types", "Name"), "string"), - (("_types", "Names"), "list"), (("_types", "Id"), "string"), - (("_types", "ExpandWildcards"), "enum"), + (("_types", "IndexName"), "string"), (("_types", "Indices"), "list"), + (("_types", "Name"), "string"), + (("_types", "Names"), "list"), + (("_types", "NodeIds"), "list"), + (("_types", "WaitForActiveShards"), "string"), // sometimes list in rest-api-spec as comma-separate values are allowed // but the Elasticsearch specification always models it as a string. (("_types", "Routing"), "string"), + (("_global.search._types", "SourceConfigParam"), "list"), (("_global.search._types", "TrackHits"), "boolean|long"), ]; @@ -279,6 +289,27 @@ fn get_enum_options(value_of: &ValueOf, types: &IndexMap, + behavior_name: &str, + types: &IndexMap, + api_name: &str +) -> Result<()> { + // Look for the behavior in the _spec_utils namespace + let behavior_type_name = TypeName::new("_spec_utils", behavior_name); + + if let Some(TypeDefinition::Interface(interface)) = types.get(&behavior_type_name) { + // Add each property from the behavior as a query parameter + for property in &interface.properties { + let converted_param = convert_parameter(property, types, api_name)?; + params.insert(property.name.clone(), converted_param); + } + } + + Ok(()) +} + /// Extract visibility information from availabilities /// Defaults to "public" if no specific visibility is set fn extract_visibility_from_availabilities(availabilities: &Option) -> Option { From 71e8b13a70edd35c879712921526cee3d3af8314 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 28 Aug 2025 11:45:29 +0400 Subject: [PATCH 12/26] Fix availability/stability --- .../src/lib.rs | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index 2b94b72462..00a74fa817 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -59,7 +59,7 @@ fn convert_endpoint( }; // Convert stability information - let stability = endpoint.availability.as_ref().map(|_| "stable".to_string()); + let stability = extract_stability_from_availabilities(&endpoint.availability); // Convert visibility information let visibility = extract_visibility_from_availabilities(&endpoint.availability); @@ -313,33 +313,35 @@ fn add_behavior_parameters( /// Extract visibility information from availabilities /// Defaults to "public" if no specific visibility is set fn extract_visibility_from_availabilities(availabilities: &Option) -> Option { + let flavor = Flavor::Stack; + if let Some(visibility) = flavor.visibility(availabilities) { + return Some(match visibility { + Visibility::Public => "public".to_string(), + Visibility::FeatureFlag => "feature_flag".to_string(), + Visibility::Private => "private".to_string(), + }) + } + + // No availability restrictions means public + Some("public".to_string()) +} + +/// Extract stability information from availabilities +/// Uses stack flavor stability, defaults to "stable" if not specified +fn extract_stability_from_availabilities(availabilities: &Option) -> Option { if let Some(avails) = availabilities { - // Check for stack flavor first, then serverless, then default to the first available - let flavor = Flavor::Stack; - if let Some(visibility) = flavor.visibility(availabilities) { - Some(match visibility { - Visibility::Public => "public".to_string(), - Visibility::FeatureFlag => "feature_flag".to_string(), - Visibility::Private => "private".to_string(), - }) - } else { - // If stack flavor is not available, try other flavors - for (_, availability) in avails { - if let Some(ref vis) = availability.visibility { - return Some(match vis { - Visibility::Public => "public".to_string(), - Visibility::FeatureFlag => "feature_flag".to_string(), - Visibility::Private => "private".to_string(), - }); - } + if let Some(stack_availability) = avails.get(&Flavor::Stack) { + if let Some(ref stability) = stack_availability.stability { + return Some(match stability { + clients_schema::Stability::Stable => "stable".to_string(), + clients_schema::Stability::Beta => "beta".to_string(), + clients_schema::Stability::Experimental => "experimental".to_string(), + }); } - // Default to public if no visibility is explicitly set - Some("public".to_string()) } - } else { - // No availability restrictions means public - Some("public".to_string()) } + // Default to stable if no stability is explicitly set + Some("stable".to_string()) } #[cfg(test)] From 106254602078afbbb275f17b218e74ce1fa99fd7 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Fri, 29 Aug 2025 10:44:10 +0400 Subject: [PATCH 13/26] Improve urls generation --- .../src/lib.rs | 153 ++++++++++++++++-- 1 file changed, 143 insertions(+), 10 deletions(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index 00a74fa817..3fd4ee43aa 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -136,19 +136,23 @@ fn convert_url_template( ) -> Result { let mut parts = HashMap::new(); - // Extract path parameters from the request type + // Extract path parameters from the request type, but only include those referenced in this URL template if let Some(request_type_name) = &endpoint.request { if let Some(TypeDefinition::Request(request)) = types.get(request_type_name) { for path_param in &request.path { - let part = PathPart { - typ: get_type_name(&path_param.typ, types, &endpoint.name, &path_param.name).to_string(), - description: path_param.description.clone().unwrap_or_default(), - deprecated: path_param.deprecation.as_ref().map(|dep| Deprecation { - version: dep.version.clone(), - description: dep.description.clone(), - }), - }; - parts.insert(path_param.name.clone(), part); + // Only include this path parameter if it's referenced in this specific URL template + let param_pattern = format!("{{{}}}", path_param.name); + if url_template.path.contains(¶m_pattern) { + let part = PathPart { + typ: get_type_name(&path_param.typ, types, &endpoint.name, &path_param.name).to_string(), + description: path_param.description.clone().unwrap_or_default(), + deprecated: path_param.deprecation.as_ref().map(|dep| Deprecation { + version: dep.version.clone(), + description: dep.description.clone(), + }), + }; + parts.insert(path_param.name.clone(), part); + } } } } @@ -407,4 +411,133 @@ mod tests { assert_eq!(body_optional.required, false); } + + #[test] + fn test_convert_url_template_only_includes_referenced_path_parts() { + use indexmap::IndexMap; + use clients_schema::{Request, Body as SchemaBody, NoBody}; + + // Create test data + let mut types = IndexMap::new(); + let request_name = TypeName::new("test", "TestRequest"); + + let path_params = vec![ + Property { + name: "index".to_string(), + typ: ValueOf::InstanceOf(InstanceOf { + typ: TypeName::new("_builtins", "string"), + generics: vec![], + }), + description: Some("Index name".to_string()), + required: true, + deprecation: None, + availability: None, + server_default: None, + doc_url: None, + doc_id: None, + ext_doc_url: None, + ext_doc_description: None, + ext_previous_version_doc_url: None, + ext_doc_id: None, + codegen_name: None, + aliases: vec![], + container_property: false, + es_quirk: None, + }, + Property { + name: "id".to_string(), + typ: ValueOf::InstanceOf(InstanceOf { + typ: TypeName::new("_builtins", "string"), + generics: vec![], + }), + description: Some("Document ID".to_string()), + required: true, + deprecation: None, + availability: None, + server_default: None, + doc_url: None, + doc_id: None, + ext_doc_url: None, + ext_doc_description: None, + ext_previous_version_doc_url: None, + ext_doc_id: None, + codegen_name: None, + aliases: vec![], + container_property: false, + es_quirk: None, + } + ]; + + let base: BaseType = BaseType::new(TypeName::new("_builtins", "string"),); + + let request = Request { + base: base, + path: path_params, + query: vec![], + body: SchemaBody::NoBody(NoBody {}), + generics: vec![], + inherits: None, + implements: vec![], + behaviors: vec![], + attached_behaviors: vec![], + examples: None + }; + + types.insert(request_name.clone(), TypeDefinition::Request(request)); + + let endpoint = SchemaEndpoint { + name: "test_endpoint".to_string(), + request: Some(request_name), + response: None, + urls: vec![], + doc_url: None, + description: "".to_string(), + request_body_required: false, + request_media_type: vec![], + response_media_type: vec![], + availability: None, + deprecation: None, + doc_id: None, + ext_doc_id: None, + ext_doc_url: None, + ext_doc_description: None, + ext_previous_version_doc_url: None, + doc_tag: None, + privileges: None, + }; + + // Test URL with index parameter only + let url_template_with_index = UrlTemplate { + path: "/{index}/_async_search".to_string(), + methods: vec!["POST".to_string()], + deprecation: None, + }; + + let path_with_index = convert_url_template(&url_template_with_index, &endpoint, &types).unwrap(); + assert_eq!(path_with_index.parts.len(), 1); + assert!(path_with_index.parts.contains_key("index")); + assert!(!path_with_index.parts.contains_key("id")); + + // Test URL with id parameter only + let url_template_with_id = UrlTemplate { + path: "/_async_search/{id}".to_string(), + methods: vec!["GET".to_string()], + deprecation: None, + }; + + let path_with_id = convert_url_template(&url_template_with_id, &endpoint, &types).unwrap(); + assert_eq!(path_with_id.parts.len(), 1); + assert!(path_with_id.parts.contains_key("id")); + assert!(!path_with_id.parts.contains_key("index")); + + // Test URL with no parameters + let url_template_no_params = UrlTemplate { + path: "/_async_search".to_string(), + methods: vec!["POST".to_string()], + deprecation: None, + }; + + let path_no_params = convert_url_template(&url_template_no_params, &endpoint, &types).unwrap(); + assert_eq!(path_no_params.parts.len(), 0); + } } \ No newline at end of file From 61ca20511c1a38503c5ea4f90f667b3a6b6b260f Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Mon, 15 Sep 2025 11:18:34 +0400 Subject: [PATCH 14/26] Serialize description only if required? --- .../src/spec.rs | 44 ++++++++++++++++++- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs index b9bed62bc5..88ef546ada 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs @@ -1,5 +1,5 @@ use std::collections::HashMap; -use serde::Serialize; +use serde::{Serialize, Serializer}; use indexmap::IndexMap; #[derive(Debug, Serialize)] @@ -62,12 +62,52 @@ pub struct Parameter { pub deprecated: Option, } -#[derive(Debug, Serialize)] +#[derive(Debug)] pub struct Body { pub description: String, pub required: bool, } +impl Serialize for Body { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + use serde::ser::SerializeStruct; + + let mut state = if self.required { + serializer.serialize_struct("Body", 2)? + } else { + serializer.serialize_struct("Body", 1)? + }; + + if self.required { + state.serialize_field("description", &self.description)?; + } + state.serialize_field("required", &self.required)?; + state.end() + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_body_serialization_with_required_false() { + let body = Body { + description: "Test description".to_string(), + required: false, + }; + + let json = serde_json::to_string(&body).unwrap(); + let parsed: serde_json::Value = serde_json::from_str(&json).unwrap(); + + assert!(parsed.get("description").is_none()); + assert_eq!(parsed["required"], false); + } +} + #[derive(Debug, Serialize)] pub struct Deprecation { pub version: String, From 00359625e9bcaa6af633bc3139706d33002e27ec Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 16 Sep 2025 16:04:16 +0400 Subject: [PATCH 15/26] Support more complex types --- .../src/lib.rs | 264 +++++++++--------- .../src/main.rs | 28 +- .../src/spec.rs | 6 +- 3 files changed, 154 insertions(+), 144 deletions(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index 3fd4ee43aa..fc4b20bb01 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -1,7 +1,7 @@ use anyhow::Result; use clients_schema::{ - IndexedModel, Endpoint as SchemaEndpoint, TypeDefinition, ValueOf, Property, - UrlTemplate, TypeName, Body as SchemaBody, Flavor, Visibility + Body as SchemaBody, Endpoint as SchemaEndpoint, Flavor, IndexedModel, InstanceOf, Property, TypeDefinition, + TypeName, UnionOf, UrlTemplate, ValueOf, Visibility, }; use indexmap::IndexMap; use std::collections::HashMap; @@ -13,41 +13,35 @@ pub mod spec; pub use spec::*; - /// Convert a clients_schema IndexedModel to individual rest-api-spec files pub fn convert_schema_to_individual_files(model: IndexedModel, output_dir: &str) -> Result<()> { // Expand generics in the model first - let expanded_model = clients_schema::transform::expand_generics( - model, - clients_schema::transform::ExpandConfig::default() - )?; - + let expanded_model = + clients_schema::transform::expand_generics(model, clients_schema::transform::ExpandConfig::default())?; + for endpoint in expanded_model.endpoints { let converted_endpoint = convert_endpoint(&endpoint, &expanded_model.types)?; - + // Wrap the JSON content with the API name let wrapped_content = HashMap::from([(endpoint.name.clone(), converted_endpoint)]); // Create filename from endpoint name let filename = format!("{}.json", endpoint.name); let file_path = StdPath::new(output_dir).join(&filename); - + // Write individual endpoint file let output_file = File::create(&file_path)?; let writer = BufWriter::new(output_file); serde_json::to_writer_pretty(writer, &wrapped_content)?; - + tracing::debug!("Wrote {} to {}", endpoint.name, file_path.display()); } - + Ok(()) } /// Convert a single endpoint from clients_schema to rest-api-spec format -fn convert_endpoint( - endpoint: &SchemaEndpoint, - types: &IndexMap -) -> Result { +fn convert_endpoint(endpoint: &SchemaEndpoint, types: &IndexMap) -> Result { // Extract documentation let documentation = Documentation { url: endpoint.doc_url.clone().unwrap_or_default(), @@ -57,36 +51,39 @@ fn convert_endpoint( Some(endpoint.description.clone()) }, }; - + // Convert stability information let stability = extract_stability_from_availabilities(&endpoint.availability); - + // Convert visibility information let visibility = extract_visibility_from_availabilities(&endpoint.availability); // Convert URL patterns - let paths = endpoint.urls.iter() + let paths = endpoint + .urls + .iter() .map(|url_template| convert_url_template(url_template, endpoint, types)) .collect::>>()?; - + let url = Url { paths }; - + // Extract parameters from the request type let mut params = IndexMap::new(); let mut body = None; - + if let Some(request_type_name) = &endpoint.request { if let Some(TypeDefinition::Request(request)) = types.get(request_type_name) { // Convert query parameters for param in &request.query { - let converted_param = convert_parameter(param, types, &endpoint.name)?; + let converted_param = convert_parameter(param, types)?; params.insert(param.name.clone(), converted_param); } - + // Add parameters from attached behaviors for behavior_name in &request.attached_behaviors { - if behavior_name != "CommonQueryParameters" { // handled in _common.json - add_behavior_parameters(&mut params, behavior_name, types, &endpoint.name)?; + if behavior_name != "CommonQueryParameters" { + // handled in _common.json + add_behavior_parameters(&mut params, behavior_name, types)?; } } @@ -99,7 +96,7 @@ fn convert_endpoint( } } } - + // Convert deprecation information let deprecated = endpoint.deprecation.as_ref().map(|dep| Deprecation { version: dep.version.clone(), @@ -115,7 +112,7 @@ fn convert_endpoint( } else { None }; - + Ok(Endpoint { documentation, stability, @@ -132,10 +129,10 @@ fn convert_endpoint( fn convert_url_template( url_template: &UrlTemplate, endpoint: &SchemaEndpoint, - types: &IndexMap + types: &IndexMap, ) -> Result { let mut parts = HashMap::new(); - + // Extract path parameters from the request type, but only include those referenced in this URL template if let Some(request_type_name) = &endpoint.request { if let Some(TypeDefinition::Request(request)) = types.get(request_type_name) { @@ -144,7 +141,7 @@ fn convert_url_template( let param_pattern = format!("{{{}}}", path_param.name); if url_template.path.contains(¶m_pattern) { let part = PathPart { - typ: get_type_name(&path_param.typ, types, &endpoint.name, &path_param.name).to_string(), + typ: get_type_name(&path_param.typ, types).to_string(), description: path_param.description.clone().unwrap_or_default(), deprecated: path_param.deprecation.as_ref().map(|dep| Deprecation { version: dep.version.clone(), @@ -156,7 +153,7 @@ fn convert_url_template( } } } - + Ok(Path { path: url_template.path.clone(), methods: url_template.methods.clone(), @@ -165,28 +162,22 @@ fn convert_url_template( } /// Convert a Property to a Parameter -fn convert_parameter( - property: &Property, - types: &IndexMap, - api_name: &str -) -> Result { - let typ = get_type_name(&property.typ, types, api_name, &property.name).to_string(); +fn convert_parameter(property: &Property, types: &IndexMap) -> Result { + let typ = get_type_name(&property.typ, types).to_string(); let mut options = get_enum_options(&property.typ, types); - - let mut default = property.server_default.as_ref().map(|default| { - match default { - clients_schema::ServerDefault::String(s) => serde_json::Value::String(s.clone()), - clients_schema::ServerDefault::Number(n) => serde_json::Value::from(*n as i64), - clients_schema::ServerDefault::Boolean(b) => serde_json::Value::Bool(*b), - clients_schema::ServerDefault::StringArray(arr) => { - serde_json::Value::Array(arr.iter().map(|s| serde_json::Value::String(s.clone())).collect()) - }, - clients_schema::ServerDefault::NumberArray(arr) => { - serde_json::Value::Array(arr.iter().map(|s| serde_json::Value::String(s.clone())).collect()) - }, + + let mut default = property.server_default.as_ref().map(|default| match default { + clients_schema::ServerDefault::String(s) => serde_json::Value::String(s.clone()), + clients_schema::ServerDefault::Number(n) => serde_json::Value::from(*n as i64), + clients_schema::ServerDefault::Boolean(b) => serde_json::Value::Bool(*b), + clients_schema::ServerDefault::StringArray(arr) => { + serde_json::Value::Array(arr.iter().map(|s| serde_json::Value::String(s.clone())).collect()) + } + clients_schema::ServerDefault::NumberArray(arr) => { + serde_json::Value::Array(arr.iter().map(|s| serde_json::Value::String(s.clone())).collect()) } }); - + // Hardcode expand_wildcards parameter if property.name == "expand_wildcards" { options = vec![ @@ -194,16 +185,16 @@ fn convert_parameter( "closed".to_string(), "hidden".to_string(), "none".to_string(), - "all".to_string() + "all".to_string(), ]; - default = Some(serde_json::Value::String("open".to_string())); + default = Some(serde_json::Value::String("all".to_string())); } let deprecated = property.deprecation.as_ref().map(|dep| Deprecation { version: dep.version.clone(), description: dep.description.clone(), }); - + Ok(Parameter { typ, description: property.description.clone().unwrap_or_default(), @@ -213,56 +204,95 @@ fn convert_parameter( }) } +// rest-api-spec types: +// list|date|time|string|enum|int|double|long|boolean|number + const BUILTIN_MAPPINGS: &[((&str, &str), &str)] = &[ (("_builtins", "string"), "string"), (("_builtins", "boolean"), "boolean"), - (("_types", "integer"), "number"), - (("_types", "long"), "number"), + (("_builtins", "number"), "number"), + (("_types", "integer"), "int"), + (("_types", "long"), "long"), + (("_types", "float"), "number"), + (("_types", "double"), "double"), (("_types", "time"), "time"), (("_types", "Duration"), "time"), + // special cases (("_types", "ExpandWildcards"), "enum"), - (("_types", "Field"), "string"), - (("_types", "Fields"), "list"), - (("_types", "Id"), "string"), - (("_types", "IndexName"), "string"), - (("_types", "Indices"), "list"), - (("_types", "Name"), "string"), - (("_types", "Names"), "list"), - (("_types", "NodeIds"), "list"), + (("_types", "DateTime"), "time"), (("_types", "WaitForActiveShards"), "string"), // sometimes list in rest-api-spec as comma-separate values are allowed // but the Elasticsearch specification always models it as a string. - (("_types", "Routing"), "string"), + (("_types", "Routing"), "list"), (("_global.search._types", "SourceConfigParam"), "list"), (("_global.search._types", "TrackHits"), "boolean|long"), ]; +fn is_list_enum(union: &UnionOf) -> bool { + // if union of X and X[] + if union.items.len() == 2 { + // check if first item is InstanceOf and second is ArrayOf + if let ValueOf::InstanceOf(instance) = &union.items[0] { + if let ValueOf::ArrayOf(array) = &union.items[1] { + let array_instance = match &*array.value { + ValueOf::InstanceOf(inst) => inst, + _ => panic!("Expected InstanceOf inside ArrayOf in union type"), + }; + if instance.typ.name == array_instance.typ.name { + return true; + } + } + } + } + return false; +} + +fn is_literal(instance: &InstanceOf) -> Option { + let key = (instance.typ.namespace.as_str(), instance.typ.name.as_str()); + if let Some(&mapped_type) = BUILTIN_MAPPINGS.iter().find(|&&(k, _)| k == key).map(|(_, v)| v) { + return Some(mapped_type.to_string()); + } else { + return None; + } +} + /// Convert a ValueOf type to a simple string representation -fn get_type_name( - value_of: &ValueOf, - types: &IndexMap, - api_name: &str, - parameter_name: &str -) -> &'static str { +fn get_type_name(value_of: &ValueOf, types: &IndexMap) -> String { match value_of { + ValueOf::ArrayOf(_) => "list".to_string(), + ValueOf::UnionOf(union) => if is_list_enum(union) { "enum" } else { todo!() }.to_string(), + ValueOf::LiteralValue(_) => "string".to_string(), ValueOf::InstanceOf(instance) => { let type_name = &instance.typ; let key = (type_name.namespace.as_str(), type_name.name.as_str()); if let Some(&mapped_type) = BUILTIN_MAPPINGS.iter().find(|&&(k, _)| k == key).map(|(_, v)| v) { - mapped_type + mapped_type.to_string() } else if let Some(TypeDefinition::Enum(_)) = types.get(type_name) { - "enum" + "enum".to_string() } else { - tracing::warn!("{}:{} -> '{}'", api_name, parameter_name, type_name); - "???" + let full_type = types.get(type_name).unwrap(); + + match full_type { + TypeDefinition::TypeAlias(ref alias) => match &alias.typ { + ValueOf::UnionOf(ref union) => { + if is_list_enum(union) { + return "list".to_string(); + } + } + ValueOf::InstanceOf(instance) => { + if let Some(literal) = is_literal(&instance) { + return literal; + } + } + _ => todo!(), + }, + _ => panic!("Expected TypeAlias but got {:?}", full_type), + } + return "???".to_string(); } } - ValueOf::ArrayOf(_) => "list", - ValueOf::UnionOf(_) => "object", - ValueOf::DictionaryOf(_) => "object", - ValueOf::UserDefinedValue(_) => "object", - ValueOf::LiteralValue(_) => "string", + _ => todo!(), } } @@ -271,20 +301,18 @@ fn get_enum_options(value_of: &ValueOf, types: &IndexMap { if let Some(TypeDefinition::Enum(enum_def)) = types.get(&instance.typ) { - enum_def.members.iter() - .map(|member| member.name.clone()) - .collect() + enum_def.members.iter().map(|member| member.name.clone()).collect() } else { vec![] } } ValueOf::UnionOf(union) => { // For union types, collect all literal values as options - union.items.iter() + union + .items + .iter() .filter_map(|item| match item { - ValueOf::LiteralValue(literal) => { - Some(literal.value.to_string()) - } + ValueOf::LiteralValue(literal) => Some(literal.value.to_string()), _ => None, }) .collect() @@ -298,7 +326,6 @@ fn add_behavior_parameters( params: &mut IndexMap, behavior_name: &str, types: &IndexMap, - api_name: &str ) -> Result<()> { // Look for the behavior in the _spec_utils namespace let behavior_type_name = TypeName::new("_spec_utils", behavior_name); @@ -306,7 +333,7 @@ fn add_behavior_parameters( if let Some(TypeDefinition::Interface(interface)) = types.get(&behavior_type_name) { // Add each property from the behavior as a query parameter for property in &interface.properties { - let converted_param = convert_parameter(property, types, api_name)?; + let converted_param = convert_parameter(property, types)?; params.insert(property.name.clone(), converted_param); } } @@ -323,7 +350,7 @@ fn extract_visibility_from_availabilities(availabilities: &Option "public".to_string(), Visibility::FeatureFlag => "feature_flag".to_string(), Visibility::Private => "private".to_string(), - }) + }); } // No availability restrictions means public @@ -356,7 +383,7 @@ mod tests { #[test] fn test_get_type_name_builtin_types() { let types = IndexMap::new(); - + // Test string type let string_type = ValueOf::InstanceOf(InstanceOf { typ: TypeName { @@ -365,30 +392,13 @@ mod tests { }, generics: vec![], }); - assert_eq!(get_type_name(&string_type, &types, "test_api", "test_param"), "string"); - + assert_eq!(get_type_name(&string_type, &types), "string"); + // Test array type let array_type = ValueOf::ArrayOf(ArrayOf { value: Box::new(string_type), }); - assert_eq!(get_type_name(&array_type, &types, "test_api", "test_param"), "list"); - } - - #[test] - fn test_get_type_name_unknown_type_logging() { - let types = IndexMap::new(); - - // Test unknown type (should trigger the enhanced logging and return "string") - let unknown_type = ValueOf::InstanceOf(InstanceOf { - typ: TypeName { - namespace: "some_namespace".into(), - name: "UnknownType".into(), - }, - generics: vec![], - }); - - // This should log a warning with API and parameter context - assert_eq!(get_type_name(&unknown_type, &types, "search_api", "query_param"), "???"); + assert_eq!(get_type_name(&array_type, &types), "list"); } #[test] @@ -414,13 +424,13 @@ mod tests { #[test] fn test_convert_url_template_only_includes_referenced_path_parts() { + use clients_schema::{Body as SchemaBody, NoBody, Request}; use indexmap::IndexMap; - use clients_schema::{Request, Body as SchemaBody, NoBody}; - + // Create test data let mut types = IndexMap::new(); let request_name = TypeName::new("test", "TestRequest"); - + let path_params = vec![ Property { name: "index".to_string(), @@ -465,10 +475,10 @@ mod tests { aliases: vec![], container_property: false, es_quirk: None, - } + }, ]; - let base: BaseType = BaseType::new(TypeName::new("_builtins", "string"),); + let base: BaseType = BaseType::new(TypeName::new("_builtins", "string")); let request = Request { base: base, @@ -480,11 +490,11 @@ mod tests { implements: vec![], behaviors: vec![], attached_behaviors: vec![], - examples: None + examples: None, }; - + types.insert(request_name.clone(), TypeDefinition::Request(request)); - + let endpoint = SchemaEndpoint { name: "test_endpoint".to_string(), request: Some(request_name), @@ -505,39 +515,39 @@ mod tests { doc_tag: None, privileges: None, }; - + // Test URL with index parameter only let url_template_with_index = UrlTemplate { path: "/{index}/_async_search".to_string(), methods: vec!["POST".to_string()], deprecation: None, }; - + let path_with_index = convert_url_template(&url_template_with_index, &endpoint, &types).unwrap(); assert_eq!(path_with_index.parts.len(), 1); assert!(path_with_index.parts.contains_key("index")); assert!(!path_with_index.parts.contains_key("id")); - - // Test URL with id parameter only + + // Test URL with id parameter only let url_template_with_id = UrlTemplate { path: "/_async_search/{id}".to_string(), methods: vec!["GET".to_string()], deprecation: None, }; - + let path_with_id = convert_url_template(&url_template_with_id, &endpoint, &types).unwrap(); assert_eq!(path_with_id.parts.len(), 1); assert!(path_with_id.parts.contains_key("id")); assert!(!path_with_id.parts.contains_key("index")); - + // Test URL with no parameters let url_template_no_params = UrlTemplate { path: "/_async_search".to_string(), methods: vec!["POST".to_string()], deprecation: None, }; - + let path_no_params = convert_url_template(&url_template_no_params, &endpoint, &types).unwrap(); assert_eq!(path_no_params.parts.len(), 0); } -} \ No newline at end of file +} diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/main.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/main.rs index cc5ba7273c..cd7712c06d 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/main.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/main.rs @@ -1,10 +1,10 @@ -use std::fs::{File, create_dir_all}; +use argh::FromArgs; use clients_schema::IndexedModel; use clients_schema_to_rest_api_spec::convert_schema_to_individual_files; +use std::fs::{create_dir_all, File}; use tracing::Level; use tracing_subscriber::fmt::format::FmtSpan; use tracing_subscriber::FmtSubscriber; -use argh::FromArgs; #[derive(FromArgs)] /// Convert clients_schema format to rest-api-spec format @@ -12,11 +12,11 @@ struct Cli { /// path to the input schema.json file #[argh(option, short = 'i')] input: String, - + /// path to the output directory for individual API files #[argh(option, short = 'o')] output_dir: String, - + /// enable verbose logging #[argh(switch, short = 'v')] verbose: bool, @@ -24,7 +24,7 @@ struct Cli { fn main() -> anyhow::Result<()> { let cli: Cli = argh::from_env(); - + // Set up logging let level = if cli.verbose { Level::DEBUG } else { Level::INFO }; let subscriber = FmtSubscriber::builder() @@ -32,26 +32,26 @@ fn main() -> anyhow::Result<()> { .with_max_level(level) .with_span_events(FmtSpan::NEW | FmtSpan::CLOSE) .finish(); - + tracing::subscriber::set_global_default(subscriber)?; - + tracing::info!("Reading schema from {}", cli.input); - + // Read and parse the input schema let input_file = File::open(&cli.input)?; let indexed_model: IndexedModel = serde_json::from_reader(input_file)?; - + tracing::info!("Converting schema to rest-api-spec format"); - + // Create output directory if it doesn't exist create_dir_all(&cli.output_dir)?; - + // Convert the schema to individual files convert_schema_to_individual_files(indexed_model, &cli.output_dir)?; - + tracing::info!("Writing individual API files to {}", cli.output_dir); - + tracing::info!("Conversion completed successfully"); - + Ok(()) } diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs index 88ef546ada..e2648db682 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/spec.rs @@ -1,6 +1,6 @@ -use std::collections::HashMap; -use serde::{Serialize, Serializer}; use indexmap::IndexMap; +use serde::{Serialize, Serializer}; +use std::collections::HashMap; #[derive(Debug, Serialize)] pub struct Endpoint { @@ -120,4 +120,4 @@ pub struct Headers { pub accept: Vec, #[serde(skip_serializing_if = "Vec::is_empty")] pub content_type: Vec, -} \ No newline at end of file +} From cb4a4e47eb66fda9032d781ac2fbf04ccf7ed57e Mon Sep 17 00:00:00 2001 From: Luke Whiting Date: Wed, 17 Sep 2025 08:02:19 +0100 Subject: [PATCH 16/26] Add spec and docs for new logs streams endpoints (#5258) * Add spec and docs for new logs streams endpoints * Add @codegen name to Acked responses * Linting fix * Update specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Correct feature flag * Add doc-ids * Fix doc-ids * Update specification/_doc_ids/table.csv Co-authored-by: Quentin Pradet * Update specification/_doc_ids/table.csv Co-authored-by: Quentin Pradet * Add default timeouts --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Quentin Pradet --- specification/_doc_ids/table.csv | 3 + .../logs_disable/StreamsLogsDisableRequest.ts | 55 +++++++++++++++++ .../StreamsLogsDisableResponse.ts | 25 ++++++++ ...ostStreamsLogsDisableResponseExample1.yaml | 6 ++ .../PostStreamsDisableRequestExample1.yaml | 3 + .../logs_enable/StreamsLogsEnableRequest.ts | 59 +++++++++++++++++++ .../logs_enable/StreamsLogsEnableResponse.ts | 25 ++++++++ ...PostStreamsLogsEnableResponseExample1.yaml | 6 ++ ...PostStreamsLogsEnableResponseExample2.yaml | 19 ++++++ .../PostStreamsEnableRequestExample1.yaml | 3 + .../streams/status/StreamsStatusRequest.ts | 47 +++++++++++++++ .../streams/status/StreamsStatusResponse.ts | 28 +++++++++ .../GetStreamsStatusResponseExample1.yaml | 9 +++ .../GetStreamsStatusRequestExample1.yaml | 3 + specification/tsconfig.json | 1 + 15 files changed, 292 insertions(+) create mode 100644 specification/streams/logs_disable/StreamsLogsDisableRequest.ts create mode 100644 specification/streams/logs_disable/StreamsLogsDisableResponse.ts create mode 100644 specification/streams/logs_disable/examples/200_response/PostStreamsLogsDisableResponseExample1.yaml create mode 100644 specification/streams/logs_disable/examples/request/PostStreamsDisableRequestExample1.yaml create mode 100644 specification/streams/logs_enable/StreamsLogsEnableRequest.ts create mode 100644 specification/streams/logs_enable/StreamsLogsEnableResponse.ts create mode 100644 specification/streams/logs_enable/examples/200_response/PostStreamsLogsEnableResponseExample1.yaml create mode 100644 specification/streams/logs_enable/examples/409_response/PostStreamsLogsEnableResponseExample2.yaml create mode 100644 specification/streams/logs_enable/examples/request/PostStreamsEnableRequestExample1.yaml create mode 100644 specification/streams/status/StreamsStatusRequest.ts create mode 100644 specification/streams/status/StreamsStatusResponse.ts create mode 100644 specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml create mode 100644 specification/streams/status/examples/request/GetStreamsStatusRequestExample1.yaml diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index cbf54e5ec3..349933ca9a 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -901,6 +901,9 @@ stop-dfanalytics,https://www.elastic.co/docs/api/doc/elasticsearch/operation/ope stop-trained-model-deployment,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-stop-trained-model-deployment,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/stop-trained-model-deployment.html, stop-transform,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-transform-stop-transform,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/stop-transform.html, stored-fields,https://www.elastic.co/docs/reference/elasticsearch/rest-apis/retrieve-selected-fields#stored-fields,, +streams-status,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,, +streams-logs-enable,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,, +streams-logs-disable,https://www.elastic.co/docs/api/doc/elasticsearch#TODO,, synonym-api-examples,https://www.elastic.co/docs/solutions/search/full-text/create-update-synonyms-api-example,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-synonyms-set.html, synonym-rule-create,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-put-synonym-rule,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/put-synonym-rule.html, synonym-rule-delete,https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-synonyms-delete-synonym-rule,https://www.elastic.co/guide/en/elasticsearch/reference/8.18/delete-synonym-rule.html, diff --git a/specification/streams/logs_disable/StreamsLogsDisableRequest.ts b/specification/streams/logs_disable/StreamsLogsDisableRequest.ts new file mode 100644 index 0000000000..85bf71a197 --- /dev/null +++ b/specification/streams/logs_disable/StreamsLogsDisableRequest.ts @@ -0,0 +1,55 @@ +/* + * 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' + +/** + * Disable logs stream + * + * This disables the logs stream feature for this cluster. + * @rest_spec_name streams.logs_disable + * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream + * @cluster_privileges manage + * @doc_id streams-logs-disable + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_streams/logs/_disable' + methods: ['POST'] + } + ] + query_parameters: { + /** + * The 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 + /** + * The 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 + } +} diff --git a/specification/streams/logs_disable/StreamsLogsDisableResponse.ts b/specification/streams/logs_disable/StreamsLogsDisableResponse.ts new file mode 100644 index 0000000000..9e7bdb91cd --- /dev/null +++ b/specification/streams/logs_disable/StreamsLogsDisableResponse.ts @@ -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 +} diff --git a/specification/streams/logs_disable/examples/200_response/PostStreamsLogsDisableResponseExample1.yaml b/specification/streams/logs_disable/examples/200_response/PostStreamsLogsDisableResponseExample1.yaml new file mode 100644 index 0000000000..3add46c389 --- /dev/null +++ b/specification/streams/logs_disable/examples/200_response/PostStreamsLogsDisableResponseExample1.yaml @@ -0,0 +1,6 @@ +summary: Disable logs streams +description: > + A successful response from `POST _streams/logs/_disable` endpoint +# type: response +value: + acknowledged: true diff --git a/specification/streams/logs_disable/examples/request/PostStreamsDisableRequestExample1.yaml b/specification/streams/logs_disable/examples/request/PostStreamsDisableRequestExample1.yaml new file mode 100644 index 0000000000..b286db3e0e --- /dev/null +++ b/specification/streams/logs_disable/examples/request/PostStreamsDisableRequestExample1.yaml @@ -0,0 +1,3 @@ +summary: 'Disable the logs streams on this cluster' +method_request: POST _streams/logs/_disable +# type: request diff --git a/specification/streams/logs_enable/StreamsLogsEnableRequest.ts b/specification/streams/logs_enable/StreamsLogsEnableRequest.ts new file mode 100644 index 0000000000..43b5948b88 --- /dev/null +++ b/specification/streams/logs_enable/StreamsLogsEnableRequest.ts @@ -0,0 +1,59 @@ +/* + * 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' + +/** + * Enable logs stream + * + * This enables the logs stream feature for this cluster. + * + * Note: To protect existing data, this feature can only be enabled on a cluster if + * it does not have existing indices or data streams matching the pattern `logs|logs.*`. + * If this is the case, a `409 - Conflict` response and error will be returned. + * @rest_spec_name streams.logs_enable + * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream + * @cluster_privileges manage + * @doc_id streams-logs-enable + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_streams/logs/_enable' + methods: ['POST'] + } + ] + query_parameters: { + /** + * The 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 + /** + * The 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 + } +} diff --git a/specification/streams/logs_enable/StreamsLogsEnableResponse.ts b/specification/streams/logs_enable/StreamsLogsEnableResponse.ts new file mode 100644 index 0000000000..9e7bdb91cd --- /dev/null +++ b/specification/streams/logs_enable/StreamsLogsEnableResponse.ts @@ -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 +} diff --git a/specification/streams/logs_enable/examples/200_response/PostStreamsLogsEnableResponseExample1.yaml b/specification/streams/logs_enable/examples/200_response/PostStreamsLogsEnableResponseExample1.yaml new file mode 100644 index 0000000000..bf5af6721a --- /dev/null +++ b/specification/streams/logs_enable/examples/200_response/PostStreamsLogsEnableResponseExample1.yaml @@ -0,0 +1,6 @@ +summary: Enable logs streams +description: > + A successful response from `POST _streams/logs/_enable` endpoint +# type: response +value: + acknowledged: true diff --git a/specification/streams/logs_enable/examples/409_response/PostStreamsLogsEnableResponseExample2.yaml b/specification/streams/logs_enable/examples/409_response/PostStreamsLogsEnableResponseExample2.yaml new file mode 100644 index 0000000000..5f20637ff6 --- /dev/null +++ b/specification/streams/logs_enable/examples/409_response/PostStreamsLogsEnableResponseExample2.yaml @@ -0,0 +1,19 @@ +summary: Enable logs streams - Failure due to conflicting index +description: > + An error response from the `POST _streams/logs/_enable` endpoint caused by attempting to enable logs streams + when an existing index with the name `logs` already exists +# type: response +value: |- + { + "error": { + "root_cause": [ + { + "type": "status_exception", + "reason": "Cannot enable logs streams: indices named 'logs' or starting with 'logs.' already exist." + } + ], + "type": "status_exception", + "reason": "Cannot enable logs streams: indices named 'logs' or starting with 'logs.' already exist." + }, + "status": 409 + } diff --git a/specification/streams/logs_enable/examples/request/PostStreamsEnableRequestExample1.yaml b/specification/streams/logs_enable/examples/request/PostStreamsEnableRequestExample1.yaml new file mode 100644 index 0000000000..246312fc54 --- /dev/null +++ b/specification/streams/logs_enable/examples/request/PostStreamsEnableRequestExample1.yaml @@ -0,0 +1,3 @@ +summary: 'Enable the logs streams on this cluster' +method_request: POST _streams/logs/_enable +# type: request diff --git a/specification/streams/status/StreamsStatusRequest.ts b/specification/streams/status/StreamsStatusRequest.ts new file mode 100644 index 0000000000..db6883d95b --- /dev/null +++ b/specification/streams/status/StreamsStatusRequest.ts @@ -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 { TimeUnit } from '@_types/Time' + +/** + * Get the status of streams + * + * Gets the current status of all stream types + * @rest_spec_name streams.status + * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream + * @cluster_privileges monitor + * @doc_id streams-status + */ +export interface Request extends RequestBase { + urls: [ + { + path: '/_streams/status' + 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?: TimeUnit + } +} diff --git a/specification/streams/status/StreamsStatusResponse.ts b/specification/streams/status/StreamsStatusResponse.ts new file mode 100644 index 0000000000..c5eb318485 --- /dev/null +++ b/specification/streams/status/StreamsStatusResponse.ts @@ -0,0 +1,28 @@ +/* + * 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. + */ + +export class Response { + body: { + logs: LogsStatus + } +} + +export class LogsStatus { + enabled: boolean +} diff --git a/specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml b/specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml new file mode 100644 index 0000000000..be7f745dcf --- /dev/null +++ b/specification/streams/status/examples/200_response/GetStreamsStatusResponseExample1.yaml @@ -0,0 +1,9 @@ +summary: Get Streams Status + A successful response from `GET _streams/status` that outlines the current state of all wired streams in the cluster. +# type: response +value: |- + { + "logs": { + "enabled": true + } + } diff --git a/specification/streams/status/examples/request/GetStreamsStatusRequestExample1.yaml b/specification/streams/status/examples/request/GetStreamsStatusRequestExample1.yaml new file mode 100644 index 0000000000..920ce2cc90 --- /dev/null +++ b/specification/streams/status/examples/request/GetStreamsStatusRequestExample1.yaml @@ -0,0 +1,3 @@ +summary: 'Get the current status of streams' +method_request: GET _streams/status +# type: request diff --git a/specification/tsconfig.json b/specification/tsconfig.json index e920f83fce..867d8f0655 100644 --- a/specification/tsconfig.json +++ b/specification/tsconfig.json @@ -50,6 +50,7 @@ "@shutdown/*": ["shutdown/*"], "@slm/*": ["slm/*"], "@snapshot/*": ["snapshot/*"], + "@streams/*": ["streams/*"], "@sql/*": ["sql/*"], "@ssl/*": ["ssl/*"], "@synonyms/*": ["synonyms/*"], From c902f4f0e046c960e9b3ca4d243485049f993602 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Wed, 17 Sep 2025 07:03:25 +0000 Subject: [PATCH 17/26] Update specification output --- output/schema/schema.json | 327 +++++++++++++++++++++++++-- output/schema/validation-errors.json | 10 +- output/typescript/types.ts | 26 +++ 3 files changed, 347 insertions(+), 16 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 3ff1f52ce0..36446e755d 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -22611,16 +22611,29 @@ "availability": { "stack": { "featureFlag": "logs_stream", - "stability": "stable", + "since": "9.1.0", + "stability": "experimental", "visibility": "feature_flag" } }, - "description": "Disable the Logs Streams feature for this cluster", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-disable.html", + "description": "Disable logs stream\n\nThis disables the logs stream feature for this cluster.", + "docId": "streams-logs-disable", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.logs_disable", - "request": null, + "privileges": { + "cluster": [ + "manage" + ] + }, + "request": { + "name": "Request", + "namespace": "streams.logs_disable" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "streams.logs_disable" + }, "responseMediaType": [ "application/json", "text/plain" @@ -22638,16 +22651,29 @@ "availability": { "stack": { "featureFlag": "logs_stream", - "stability": "stable", + "since": "9.1.0", + "stability": "experimental", "visibility": "feature_flag" } }, - "description": "Enable the Logs Streams feature for this cluster", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-logs-enable.html", + "description": "Enable logs stream\n\nThis enables the logs stream feature for this cluster.\n\nNote: To protect existing data, this feature can only be enabled on a cluster if\nit does not have existing indices or data streams matching the pattern `logs|logs.*`.\nIf this is the case, a `409 - Conflict` response and error will be returned.", + "docId": "streams-logs-enable", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.logs_enable", - "request": null, + "privileges": { + "cluster": [ + "manage" + ] + }, + "request": { + "name": "Request", + "namespace": "streams.logs_enable" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "streams.logs_enable" + }, "responseMediaType": [ "application/json", "text/plain" @@ -22665,16 +22691,29 @@ "availability": { "stack": { "featureFlag": "logs_stream", - "stability": "stable", + "since": "9.1.0", + "stability": "experimental", "visibility": "feature_flag" } }, - "description": "Return the current status of the streams feature for each streams type", - "docUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/master/streams-status.html", + "description": "Get the status of streams\n\nGets the current status of all stream types", + "docId": "streams-status", + "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.status", - "request": null, + "privileges": { + "cluster": [ + "monitor" + ] + }, + "request": { + "name": "Request", + "namespace": "streams.status" + }, "requestBodyRequired": false, - "response": null, + "response": { + "name": "Response", + "namespace": "streams.status" + }, "responseMediaType": [ "application/json" ], @@ -258225,6 +258264,264 @@ }, "specLocation": "ssl/certificates/GetCertificatesResponse.ts#L22-L25" }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Disable logs stream\n\nThis disables the logs stream feature for this cluster.", + "examples": { + "PostStreamsDisableRequestExample1": { + "method_request": "POST _streams/logs/_disable", + "summary": "Disable the logs streams on this cluster" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "streams.logs_disable" + }, + "path": [], + "query": [ + { + "description": "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", + "name": "timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "streams/logs_disable/StreamsLogsDisableRequest.ts#L23-L55" + }, + { + "kind": "response", + "body": { + "kind": "value", + "codegenName": "result", + "value": { + "kind": "instance_of", + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + } + }, + "examples": { + "PostStreamsLogsDisableResponseExample1": { + "description": "A successful response from `POST _streams/logs/_disable` endpoint\n", + "summary": "Disable logs streams", + "value": "{\n \"acknowledged\": true\n}" + } + }, + "name": { + "name": "Response", + "namespace": "streams.logs_disable" + }, + "specLocation": "streams/logs_disable/StreamsLogsDisableResponse.ts#L22-L25" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Enable logs stream\n\nThis enables the logs stream feature for this cluster.\n\nNote: To protect existing data, this feature can only be enabled on a cluster if\nit does not have existing indices or data streams matching the pattern `logs|logs.*`.\nIf this is the case, a `409 - Conflict` response and error will be returned.", + "examples": { + "PostStreamsEnableRequestExample1": { + "method_request": "POST _streams/logs/_enable", + "summary": "Enable the logs streams on this cluster" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "streams.logs_enable" + }, + "path": [], + "query": [ + { + "description": "The period to wait for a connection to the master node.\nIf no response is received before the timeout expires, the request fails and returns an error.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + }, + { + "description": "The period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", + "name": "timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "Duration", + "namespace": "_types" + } + } + } + ], + "specLocation": "streams/logs_enable/StreamsLogsEnableRequest.ts#L23-L59" + }, + { + "kind": "response", + "body": { + "kind": "value", + "codegenName": "result", + "value": { + "kind": "instance_of", + "type": { + "name": "AcknowledgedResponseBase", + "namespace": "_types" + } + } + }, + "examples": { + "PostStreamsLogsEnableResponseExample1": { + "description": "A successful response from `POST _streams/logs/_enable` endpoint\n", + "summary": "Enable logs streams", + "value": "{\n \"acknowledged\": true\n}" + } + }, + "name": { + "name": "Response", + "namespace": "streams.logs_enable" + }, + "specLocation": "streams/logs_enable/StreamsLogsEnableResponse.ts#L22-L25" + }, + { + "kind": "interface", + "name": { + "name": "LogsStatus", + "namespace": "streams.status" + }, + "properties": [ + { + "name": "enabled", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } + } + ], + "specLocation": "streams/status/StreamsStatusResponse.ts#L26-L28" + }, + { + "kind": "request", + "attachedBehaviors": [ + "CommonQueryParameters" + ], + "body": { + "kind": "no_body" + }, + "description": "Get the status of streams\n\nGets the current status of all stream types", + "examples": { + "GetStreamsStatusRequestExample1": { + "method_request": "GET _streams/status", + "summary": "Get the current status of streams" + } + }, + "inherits": { + "type": { + "name": "RequestBase", + "namespace": "_types" + } + }, + "name": { + "name": "Request", + "namespace": "streams.status" + }, + "path": [], + "query": [ + { + "description": "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.", + "name": "master_timeout", + "required": false, + "serverDefault": "30s", + "type": { + "kind": "instance_of", + "type": { + "name": "TimeUnit", + "namespace": "_types" + } + } + } + ], + "specLocation": "streams/status/StreamsStatusRequest.ts#L23-L47" + }, + { + "kind": "response", + "body": { + "kind": "properties", + "properties": [ + { + "name": "logs", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "LogsStatus", + "namespace": "streams.status" + } + } + } + ] + }, + "examples": { + "GetStreamsStatusResponseExample1": { + "summary": "Get Streams Status A successful response from `GET _streams/status` that outlines the current state of all wired streams in the cluster.", + "value": "{\n \"logs\": {\n \"enabled\": true\n }\n}" + } + }, + "name": { + "name": "Response", + "namespace": "streams.status" + }, + "specLocation": "streams/status/StreamsStatusResponse.ts#L20-L24" + }, { "kind": "interface", "name": { diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 6d18a016b7..34717a8197 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1,5 +1,13 @@ { - "endpointErrors": {}, + "endpointErrors": { + "streams.status": { + "request": [ + "Request: query parameter 'master_timeout' does not exist in the json spec", + "Request: missing json spec query parameter 'mater_timeout'" + ], + "response": [] + } + }, "generalErrors": [ "Dangling type '_global.scripts_painless_execute:PainlessExecutionPosition'", "Dangling type '_global.scripts_painless_execute:PainlessScript'", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 42f9e5e800..eb87db9c35 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -22029,6 +22029,32 @@ export interface SslCertificatesRequest extends RequestBase { export type SslCertificatesResponse = SslCertificatesCertificateInformation[] +export interface StreamsLogsDisableRequest extends RequestBase { + master_timeout?: Duration + timeout?: Duration +} + +export type StreamsLogsDisableResponse = AcknowledgedResponseBase + +export interface StreamsLogsEnableRequest extends RequestBase { + master_timeout?: Duration + timeout?: Duration +} + +export type StreamsLogsEnableResponse = AcknowledgedResponseBase + +export interface StreamsStatusLogsStatus { + enabled: boolean +} + +export interface StreamsStatusRequest extends RequestBase { + master_timeout?: TimeUnit +} + +export interface StreamsStatusResponse { + logs: StreamsStatusLogsStatus +} + export interface SynonymsSynonymRule { id?: Id synonyms: SynonymsSynonymString From ff98251d3b26dd22292eaa88bbcbbb1534ad3120 Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 17 Sep 2025 09:01:02 +0100 Subject: [PATCH 18/26] Add common cat API parameters for unit rendering (#5298) Describes the `?bytes=` and `?time=` parameters which are accepted by all the `GET _cat/...` APIs. --- output/openapi/elasticsearch-openapi.json | 377 ------------------ .../elasticsearch-serverless-openapi.json | 183 --------- output/schema/schema.json | 366 +++-------------- output/schema/validation-errors.json | 116 ++++++ output/typescript/types.ts | 36 +- specification/_spec_utils/behaviors.ts | 18 + .../cat/allocation/CatAllocationRequest.ts | 4 +- .../cat/fielddata/CatFielddataRequest.ts | 4 +- specification/cat/health/CatHealthRequest.ts | 5 - .../cat/indices/CatIndicesRequest.ts | 14 +- .../CatDataFrameAnalyticsRequest.ts | 8 +- .../cat/ml_datafeeds/CatDatafeedsRequest.ts | 5 - specification/cat/ml_jobs/CatJobsRequest.ts | 11 +- .../CatTrainedModelsRequest.ts | 9 +- specification/cat/nodes/CatNodesRequest.ts | 12 +- .../pending_tasks/CatPendingTasksRequest.ts | 6 +- .../cat/recovery/CatRecoveryRequest.ts | 11 +- .../cat/segments/CatSegmentsRequest.ts | 6 +- specification/cat/shards/CatShardsRequest.ts | 12 +- .../cat/snapshots/CatSnapshotsRequest.ts | 6 +- specification/cat/tasks/CatTasksRequest.ts | 6 +- .../cat/thread_pool/CatThreadPoolRequest.ts | 6 +- .../cat/transforms/CatTransformsRequest.ts | 5 - .../delete_node/ShutdownDeleteNodeRequest.ts | 6 +- .../get_node/ShutdownGetNodeRequest.ts | 4 +- .../put_node/ShutdownPutNodeRequest.ts | 6 +- 26 files changed, 217 insertions(+), 1025 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index d57293d893..4245b1d855 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -865,9 +865,6 @@ "description": "Get a snapshot of the number of shards allocated to each data node and their disk space.\n\nIMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n", "operationId": "cat-allocation", "parameters": [ - { - "$ref": "#/components/parameters/cat.allocation-bytes" - }, { "$ref": "#/components/parameters/cat.allocation-h" }, @@ -907,9 +904,6 @@ { "$ref": "#/components/parameters/cat.allocation-node_id" }, - { - "$ref": "#/components/parameters/cat.allocation-bytes" - }, { "$ref": "#/components/parameters/cat.allocation-h" }, @@ -1084,9 +1078,6 @@ "description": "Get the amount of heap memory currently used by the field data cache on every data node in the cluster.\n\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console.\nThey are not intended for use by applications. For application consumption, use the nodes stats API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n", "operationId": "cat-fielddata", "parameters": [ - { - "$ref": "#/components/parameters/cat.fielddata-bytes" - }, { "$ref": "#/components/parameters/cat.fielddata-fields_" }, @@ -1123,9 +1114,6 @@ { "$ref": "#/components/parameters/cat.fielddata-fields" }, - { - "$ref": "#/components/parameters/cat.fielddata-bytes" - }, { "$ref": "#/components/parameters/cat.fielddata-fields_" }, @@ -1159,16 +1147,6 @@ "description": "IMPORTANT: CAT APIs are only intended for human consumption using the command line or Kibana console.\nThey are not intended for use by applications. For application consumption, use the cluster health API.\nThis API is often used to check malfunctioning clusters.\nTo help you track cluster health alongside log files and alerting systems, the API returns timestamps in two formats:\n`HH:MM:SS`, which is human-readable but includes no date information;\n`Unix epoch time`, which is machine-sortable and includes date information.\nThe latter format is useful for cluster recoveries that take multiple days.\nYou can use the cat health API to verify cluster health across multiple nodes.\nYou also can use the API to track the recovery of a large cluster over a longer period of time.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n", "operationId": "cat-health", "parameters": [ - { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, { "in": "query", "name": "ts", @@ -1268,9 +1246,6 @@ "description": "Get high-level information about indices in a cluster, including backing indices for data streams.\n\nUse this request to get the following information for each index in a cluster:\n- shard count\n- document count\n- deleted document count\n- primary store size\n- total store size of all shards, including shard replicas\n\nThese metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents.\nTo get an accurate count of Elasticsearch documents, use the cat count or count APIs.\n\nCAT APIs are only intended for human consumption using the command line or Kibana console.\nThey are not intended for use by applications. For application consumption, use an index endpoint.\n\n## Required authorization\n\n* Index privileges: `monitor`\n* Cluster privileges: `monitor`\n", "operationId": "cat-indices", "parameters": [ - { - "$ref": "#/components/parameters/cat.indices-bytes" - }, { "$ref": "#/components/parameters/cat.indices-expand_wildcards" }, @@ -1283,9 +1258,6 @@ { "$ref": "#/components/parameters/cat.indices-pri" }, - { - "$ref": "#/components/parameters/cat.indices-time" - }, { "$ref": "#/components/parameters/cat.indices-master_timeout" }, @@ -1322,9 +1294,6 @@ { "$ref": "#/components/parameters/cat.indices-index" }, - { - "$ref": "#/components/parameters/cat.indices-bytes" - }, { "$ref": "#/components/parameters/cat.indices-expand_wildcards" }, @@ -1337,9 +1306,6 @@ { "$ref": "#/components/parameters/cat.indices-pri" }, - { - "$ref": "#/components/parameters/cat.indices-time" - }, { "$ref": "#/components/parameters/cat.indices-master_timeout" }, @@ -1456,17 +1422,11 @@ { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_data_frame_analytics-bytes" - }, { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-h" }, { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-s" - }, - { - "$ref": "#/components/parameters/cat.ml_data_frame_analytics-time" } ], "responses": { @@ -1498,17 +1458,11 @@ { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_data_frame_analytics-bytes" - }, { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-h" }, { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-s" - }, - { - "$ref": "#/components/parameters/cat.ml_data_frame_analytics-time" } ], "responses": { @@ -1542,9 +1496,6 @@ }, { "$ref": "#/components/parameters/cat.ml_datafeeds-s" - }, - { - "$ref": "#/components/parameters/cat.ml_datafeeds-time" } ], "responses": { @@ -1581,9 +1532,6 @@ }, { "$ref": "#/components/parameters/cat.ml_datafeeds-s" - }, - { - "$ref": "#/components/parameters/cat.ml_datafeeds-time" } ], "responses": { @@ -1612,17 +1560,11 @@ { "$ref": "#/components/parameters/cat.ml_jobs-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_jobs-bytes" - }, { "$ref": "#/components/parameters/cat.ml_jobs-h" }, { "$ref": "#/components/parameters/cat.ml_jobs-s" - }, - { - "$ref": "#/components/parameters/cat.ml_jobs-time" } ], "responses": { @@ -1654,17 +1596,11 @@ { "$ref": "#/components/parameters/cat.ml_jobs-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_jobs-bytes" - }, { "$ref": "#/components/parameters/cat.ml_jobs-h" }, { "$ref": "#/components/parameters/cat.ml_jobs-s" - }, - { - "$ref": "#/components/parameters/cat.ml_jobs-time" } ], "responses": { @@ -1693,9 +1629,6 @@ { "$ref": "#/components/parameters/cat.ml_trained_models-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_trained_models-bytes" - }, { "$ref": "#/components/parameters/cat.ml_trained_models-h" }, @@ -1707,9 +1640,6 @@ }, { "$ref": "#/components/parameters/cat.ml_trained_models-size" - }, - { - "$ref": "#/components/parameters/cat.ml_trained_models-time" } ], "responses": { @@ -1741,9 +1671,6 @@ { "$ref": "#/components/parameters/cat.ml_trained_models-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_trained_models-bytes" - }, { "$ref": "#/components/parameters/cat.ml_trained_models-h" }, @@ -1755,9 +1682,6 @@ }, { "$ref": "#/components/parameters/cat.ml_trained_models-size" - }, - { - "$ref": "#/components/parameters/cat.ml_trained_models-time" } ], "responses": { @@ -1869,16 +1793,6 @@ "description": "Get information about the nodes in a cluster.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the nodes info API.\n\n## Required authorization\n\n* Cluster privileges: `monitor`\n", "operationId": "cat-nodes", "parameters": [ - { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, { "in": "query", "name": "full_id", @@ -1935,16 +1849,6 @@ "$ref": "#/components/schemas/_types.Duration" }, "style": "form" - }, - { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" } ], "responses": { @@ -2031,16 +1935,6 @@ "$ref": "#/components/schemas/_types.Duration" }, "style": "form" - }, - { - "in": "query", - "name": "time", - "description": "Unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" } ], "responses": { @@ -2175,9 +2069,6 @@ { "$ref": "#/components/parameters/cat.recovery-active_only" }, - { - "$ref": "#/components/parameters/cat.recovery-bytes" - }, { "$ref": "#/components/parameters/cat.recovery-detailed" }, @@ -2189,9 +2080,6 @@ }, { "$ref": "#/components/parameters/cat.recovery-s" - }, - { - "$ref": "#/components/parameters/cat.recovery-time" } ], "responses": { @@ -2223,9 +2111,6 @@ { "$ref": "#/components/parameters/cat.recovery-active_only" }, - { - "$ref": "#/components/parameters/cat.recovery-bytes" - }, { "$ref": "#/components/parameters/cat.recovery-detailed" }, @@ -2237,9 +2122,6 @@ }, { "$ref": "#/components/parameters/cat.recovery-s" - }, - { - "$ref": "#/components/parameters/cat.recovery-time" } ], "responses": { @@ -2345,9 +2227,6 @@ "description": "Get low-level information about the Lucene segments in index shards.\nFor data streams, the API returns information about the backing indices.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications. For application consumption, use the index segments API.\n\n## Required authorization\n\n* Index privileges: `monitor`\n* Cluster privileges: `monitor`\n", "operationId": "cat-segments", "parameters": [ - { - "$ref": "#/components/parameters/cat.segments-bytes" - }, { "$ref": "#/components/parameters/cat.segments-h" }, @@ -2387,9 +2266,6 @@ { "$ref": "#/components/parameters/cat.segments-index" }, - { - "$ref": "#/components/parameters/cat.segments-bytes" - }, { "$ref": "#/components/parameters/cat.segments-h" }, @@ -2426,9 +2302,6 @@ "description": "Get information about the shards in a cluster.\nFor data streams, the API returns information about the backing indices.\nIMPORTANT: cat APIs are only intended for human consumption using the command line or Kibana console. They are not intended for use by applications.\n\n## Required authorization\n\n* Index privileges: `monitor`\n* Cluster privileges: `monitor`\n", "operationId": "cat-shards", "parameters": [ - { - "$ref": "#/components/parameters/cat.shards-bytes" - }, { "$ref": "#/components/parameters/cat.shards-h" }, @@ -2437,9 +2310,6 @@ }, { "$ref": "#/components/parameters/cat.shards-master_timeout" - }, - { - "$ref": "#/components/parameters/cat.shards-time" } ], "responses": { @@ -2468,9 +2338,6 @@ { "$ref": "#/components/parameters/cat.shards-index" }, - { - "$ref": "#/components/parameters/cat.shards-bytes" - }, { "$ref": "#/components/parameters/cat.shards-h" }, @@ -2479,9 +2346,6 @@ }, { "$ref": "#/components/parameters/cat.shards-master_timeout" - }, - { - "$ref": "#/components/parameters/cat.shards-time" } ], "responses": { @@ -2518,9 +2382,6 @@ }, { "$ref": "#/components/parameters/cat.snapshots-master_timeout" - }, - { - "$ref": "#/components/parameters/cat.snapshots-time" } ], "responses": { @@ -2560,9 +2421,6 @@ }, { "$ref": "#/components/parameters/cat.snapshots-master_timeout" - }, - { - "$ref": "#/components/parameters/cat.snapshots-time" } ], "responses": { @@ -2654,16 +2512,6 @@ }, "style": "form" }, - { - "in": "query", - "name": "time", - "description": "Unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, { "in": "query", "name": "timeout", @@ -2805,9 +2653,6 @@ { "$ref": "#/components/parameters/cat.thread_pool-s" }, - { - "$ref": "#/components/parameters/cat.thread_pool-time" - }, { "$ref": "#/components/parameters/cat.thread_pool-local" }, @@ -2847,9 +2692,6 @@ { "$ref": "#/components/parameters/cat.thread_pool-s" }, - { - "$ref": "#/components/parameters/cat.thread_pool-time" - }, { "$ref": "#/components/parameters/cat.thread_pool-local" }, @@ -2892,9 +2734,6 @@ { "$ref": "#/components/parameters/cat.transforms-s" }, - { - "$ref": "#/components/parameters/cat.transforms-time" - }, { "$ref": "#/components/parameters/cat.transforms-size" } @@ -2937,9 +2776,6 @@ { "$ref": "#/components/parameters/cat.transforms-s" }, - { - "$ref": "#/components/parameters/cat.transforms-time" - }, { "$ref": "#/components/parameters/cat.transforms-size" } @@ -71296,17 +71132,6 @@ } ] }, - "_types.Bytes": { - "type": "string", - "enum": [ - "b", - "kb", - "mb", - "gb", - "tb", - "pb" - ] - }, "cat._types.CatAllocationColumns": { "oneOf": [ { @@ -71780,18 +71605,6 @@ } } }, - "_types.TimeUnit": { - "type": "string", - "enum": [ - "nanos", - "micros", - "ms", - "s", - "m", - "h", - "d" - ] - }, "cat._types.CatHealthColumns": { "oneOf": [ { @@ -136003,16 +135816,6 @@ }, "style": "simple" }, - "cat.allocation-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.allocation-h": { "in": "query", "name": "h", @@ -136146,16 +135949,6 @@ }, "style": "simple" }, - "cat.fielddata-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.fielddata-fields_": { "in": "query", "name": "fields", @@ -136197,16 +135990,6 @@ }, "style": "simple" }, - "cat.indices-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.indices-expand_wildcards": { "in": "query", "name": "expand_wildcards", @@ -136247,16 +136030,6 @@ }, "style": "form" }, - "cat.indices-time": { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.indices-master_timeout": { "in": "query", "name": "master_timeout", @@ -136308,16 +136081,6 @@ }, "style": "form" }, - "cat.ml_data_frame_analytics-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit in which to display byte values", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.ml_data_frame_analytics-h": { "in": "query", "name": "h", @@ -136338,16 +136101,6 @@ }, "style": "form" }, - "cat.ml_data_frame_analytics-time": { - "in": "query", - "name": "time", - "description": "Unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.ml_datafeeds-datafeed_id": { "in": "path", "name": "datafeed_id", @@ -136389,16 +136142,6 @@ }, "style": "form" }, - "cat.ml_datafeeds-time": { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.ml_jobs-job_id": { "in": "path", "name": "job_id", @@ -136420,16 +136163,6 @@ }, "style": "form" }, - "cat.ml_jobs-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.ml_jobs-h": { "in": "query", "name": "h", @@ -136450,16 +136183,6 @@ }, "style": "form" }, - "cat.ml_jobs-time": { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.ml_trained_models-model_id": { "in": "path", "name": "model_id", @@ -136481,16 +136204,6 @@ }, "style": "form" }, - "cat.ml_trained_models-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.ml_trained_models-h": { "in": "query", "name": "h", @@ -136531,16 +136244,6 @@ }, "style": "form" }, - "cat.ml_trained_models-time": { - "in": "query", - "name": "time", - "description": "Unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.recovery-index": { "in": "path", "name": "index", @@ -136562,16 +136265,6 @@ }, "style": "form" }, - "cat.recovery-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.recovery-detailed": { "in": "query", "name": "detailed", @@ -136612,16 +136305,6 @@ }, "style": "form" }, - "cat.recovery-time": { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.segments-index": { "in": "path", "name": "index", @@ -136633,16 +136316,6 @@ }, "style": "simple" }, - "cat.segments-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.segments-h": { "in": "query", "name": "h", @@ -136694,16 +136367,6 @@ }, "style": "simple" }, - "cat.shards-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.shards-h": { "in": "query", "name": "h", @@ -136734,16 +136397,6 @@ }, "style": "form" }, - "cat.shards-time": { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.snapshots-repository": { "in": "path", "name": "repository", @@ -136795,16 +136448,6 @@ }, "style": "form" }, - "cat.snapshots-time": { - "in": "query", - "name": "time", - "description": "Unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.templates-name": { "in": "path", "name": "name", @@ -136887,16 +136530,6 @@ }, "style": "form" }, - "cat.thread_pool-time": { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.thread_pool-local": { "in": "query", "name": "local", @@ -136968,16 +136601,6 @@ }, "style": "form" }, - "cat.transforms-time": { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.transforms-size": { "in": "query", "name": "size", diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 52abddffe1..aa7653efe9 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -1032,9 +1032,6 @@ "description": "Get high-level information about indices in a cluster, including backing indices for data streams.\n\nUse this request to get the following information for each index in a cluster:\n- shard count\n- document count\n- deleted document count\n- primary store size\n- total store size of all shards, including shard replicas\n\nThese metrics are retrieved directly from Lucene, which Elasticsearch uses internally to power indexing and search. As a result, all document counts include hidden nested documents.\nTo get an accurate count of Elasticsearch documents, use the cat count or count APIs.\n\nCAT APIs are only intended for human consumption using the command line or Kibana console.\nThey are not intended for use by applications. For application consumption, use an index endpoint.\n\n## Required authorization\n\n* Index privileges: `monitor`\n* Cluster privileges: `monitor`\n", "operationId": "cat-indices", "parameters": [ - { - "$ref": "#/components/parameters/cat.indices-bytes" - }, { "$ref": "#/components/parameters/cat.indices-expand_wildcards" }, @@ -1047,9 +1044,6 @@ { "$ref": "#/components/parameters/cat.indices-pri" }, - { - "$ref": "#/components/parameters/cat.indices-time" - }, { "$ref": "#/components/parameters/cat.indices-master_timeout" }, @@ -1086,9 +1080,6 @@ { "$ref": "#/components/parameters/cat.indices-index" }, - { - "$ref": "#/components/parameters/cat.indices-bytes" - }, { "$ref": "#/components/parameters/cat.indices-expand_wildcards" }, @@ -1101,9 +1092,6 @@ { "$ref": "#/components/parameters/cat.indices-pri" }, - { - "$ref": "#/components/parameters/cat.indices-time" - }, { "$ref": "#/components/parameters/cat.indices-master_timeout" }, @@ -1140,17 +1128,11 @@ { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_data_frame_analytics-bytes" - }, { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-h" }, { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-s" - }, - { - "$ref": "#/components/parameters/cat.ml_data_frame_analytics-time" } ], "responses": { @@ -1182,17 +1164,11 @@ { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_data_frame_analytics-bytes" - }, { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-h" }, { "$ref": "#/components/parameters/cat.ml_data_frame_analytics-s" - }, - { - "$ref": "#/components/parameters/cat.ml_data_frame_analytics-time" } ], "responses": { @@ -1226,9 +1202,6 @@ }, { "$ref": "#/components/parameters/cat.ml_datafeeds-s" - }, - { - "$ref": "#/components/parameters/cat.ml_datafeeds-time" } ], "responses": { @@ -1265,9 +1238,6 @@ }, { "$ref": "#/components/parameters/cat.ml_datafeeds-s" - }, - { - "$ref": "#/components/parameters/cat.ml_datafeeds-time" } ], "responses": { @@ -1296,17 +1266,11 @@ { "$ref": "#/components/parameters/cat.ml_jobs-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_jobs-bytes" - }, { "$ref": "#/components/parameters/cat.ml_jobs-h" }, { "$ref": "#/components/parameters/cat.ml_jobs-s" - }, - { - "$ref": "#/components/parameters/cat.ml_jobs-time" } ], "responses": { @@ -1338,17 +1302,11 @@ { "$ref": "#/components/parameters/cat.ml_jobs-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_jobs-bytes" - }, { "$ref": "#/components/parameters/cat.ml_jobs-h" }, { "$ref": "#/components/parameters/cat.ml_jobs-s" - }, - { - "$ref": "#/components/parameters/cat.ml_jobs-time" } ], "responses": { @@ -1377,9 +1335,6 @@ { "$ref": "#/components/parameters/cat.ml_trained_models-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_trained_models-bytes" - }, { "$ref": "#/components/parameters/cat.ml_trained_models-h" }, @@ -1391,9 +1346,6 @@ }, { "$ref": "#/components/parameters/cat.ml_trained_models-size" - }, - { - "$ref": "#/components/parameters/cat.ml_trained_models-time" } ], "responses": { @@ -1425,9 +1377,6 @@ { "$ref": "#/components/parameters/cat.ml_trained_models-allow_no_match" }, - { - "$ref": "#/components/parameters/cat.ml_trained_models-bytes" - }, { "$ref": "#/components/parameters/cat.ml_trained_models-h" }, @@ -1439,9 +1388,6 @@ }, { "$ref": "#/components/parameters/cat.ml_trained_models-size" - }, - { - "$ref": "#/components/parameters/cat.ml_trained_models-time" } ], "responses": { @@ -1479,9 +1425,6 @@ { "$ref": "#/components/parameters/cat.transforms-s" }, - { - "$ref": "#/components/parameters/cat.transforms-time" - }, { "$ref": "#/components/parameters/cat.transforms-size" } @@ -1524,9 +1467,6 @@ { "$ref": "#/components/parameters/cat.transforms-s" }, - { - "$ref": "#/components/parameters/cat.transforms-time" - }, { "$ref": "#/components/parameters/cat.transforms-size" } @@ -47565,17 +47505,6 @@ "description": "Time of day, expressed as HH:MM:SS", "type": "string" }, - "_types.Bytes": { - "type": "string", - "enum": [ - "b", - "kb", - "mb", - "gb", - "tb", - "pb" - ] - }, "_types.HealthStatus": { "type": "string", "enum": [ @@ -47589,18 +47518,6 @@ "unavailable" ] }, - "_types.TimeUnit": { - "type": "string", - "enum": [ - "nanos", - "micros", - "ms", - "s", - "m", - "h", - "d" - ] - }, "cat._types.CatIndicesColumns": { "oneOf": [ { @@ -83465,16 +83382,6 @@ }, "style": "simple" }, - "cat.indices-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.indices-expand_wildcards": { "in": "query", "name": "expand_wildcards", @@ -83515,16 +83422,6 @@ }, "style": "form" }, - "cat.indices-time": { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.indices-master_timeout": { "in": "query", "name": "master_timeout", @@ -83576,16 +83473,6 @@ }, "style": "form" }, - "cat.ml_data_frame_analytics-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit in which to display byte values", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.ml_data_frame_analytics-h": { "in": "query", "name": "h", @@ -83606,16 +83493,6 @@ }, "style": "form" }, - "cat.ml_data_frame_analytics-time": { - "in": "query", - "name": "time", - "description": "Unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.ml_datafeeds-datafeed_id": { "in": "path", "name": "datafeed_id", @@ -83657,16 +83534,6 @@ }, "style": "form" }, - "cat.ml_datafeeds-time": { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.ml_jobs-job_id": { "in": "path", "name": "job_id", @@ -83688,16 +83555,6 @@ }, "style": "form" }, - "cat.ml_jobs-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.ml_jobs-h": { "in": "query", "name": "h", @@ -83718,16 +83575,6 @@ }, "style": "form" }, - "cat.ml_jobs-time": { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.ml_trained_models-model_id": { "in": "path", "name": "model_id", @@ -83749,16 +83596,6 @@ }, "style": "form" }, - "cat.ml_trained_models-bytes": { - "in": "query", - "name": "bytes", - "description": "The unit used to display byte values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.Bytes" - }, - "style": "form" - }, "cat.ml_trained_models-h": { "in": "query", "name": "h", @@ -83799,16 +83636,6 @@ }, "style": "form" }, - "cat.ml_trained_models-time": { - "in": "query", - "name": "time", - "description": "Unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.transforms-transform_id": { "in": "path", "name": "transform_id", @@ -83860,16 +83687,6 @@ }, "style": "form" }, - "cat.transforms-time": { - "in": "query", - "name": "time", - "description": "The unit used to display time values.", - "deprecated": false, - "schema": { - "$ref": "#/components/schemas/_types.TimeUnit" - }, - "style": "form" - }, "cat.transforms-size": { "in": "query", "name": "size", diff --git a/output/schema/schema.json b/output/schema/schema.json index 36446e755d..82754bc9d3 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -105633,18 +105633,6 @@ } ], "query": [ - { - "description": "The unit used to display byte values.", - "name": "bytes", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Bytes", - "namespace": "_types" - } - } - }, { "description": "A comma-separated list of columns names to display. It supports simple wildcards.", "name": "h", @@ -105696,7 +105684,7 @@ } } ], - "specLocation": "cat/allocation/CatAllocationRequest.ts#L24-L78" + "specLocation": "cat/allocation/CatAllocationRequest.ts#L24-L76" }, { "kind": "response", @@ -106322,18 +106310,6 @@ } ], "query": [ - { - "description": "The unit used to display byte values.", - "name": "bytes", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Bytes", - "namespace": "_types" - } - } - }, { "description": "Comma-separated list of fields used to limit returned information.", "name": "fields", @@ -106371,7 +106347,7 @@ } } ], - "specLocation": "cat/fielddata/CatFielddataRequest.ts#L23-L70" + "specLocation": "cat/fielddata/CatFielddataRequest.ts#L23-L68" }, { "kind": "response", @@ -106729,18 +106705,6 @@ }, "path": [], "query": [ - { - "description": "The unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } - }, { "description": "If true, returns `HH:MM:SS` and Unix epoch timestamps.", "name": "ts", @@ -106779,7 +106743,7 @@ } } ], - "specLocation": "cat/health/CatHealthRequest.ts#L24-L70" + "specLocation": "cat/health/CatHealthRequest.ts#L23-L65" }, { "kind": "response", @@ -108979,18 +108943,6 @@ } ], "query": [ - { - "description": "The unit used to display byte values.", - "name": "bytes", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Bytes", - "namespace": "_types" - } - } - }, { "description": "The type of index that wildcard patterns can match.", "name": "expand_wildcards", @@ -109041,18 +108993,6 @@ } } }, - { - "description": "The unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } - }, { "description": "Period to wait for a connection to the master node.", "name": "master_timeout", @@ -109091,7 +109031,7 @@ } } ], - "specLocation": "cat/indices/CatIndicesRequest.ts#L30-L109" + "specLocation": "cat/indices/CatIndicesRequest.ts#L24-L99" }, { "kind": "response", @@ -109646,18 +109586,6 @@ } } }, - { - "description": "The unit in which to display byte values", - "name": "bytes", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Bytes", - "namespace": "_types" - } - } - }, { "description": "Comma-separated list of column names to display.", "name": "h", @@ -109682,21 +109610,9 @@ "namespace": "cat._types" } } - }, - { - "description": "Unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } } ], - "specLocation": "cat/ml_data_frame_analytics/CatDataFrameAnalyticsRequest.ts#L24-L70" + "specLocation": "cat/ml_data_frame_analytics/CatDataFrameAnalyticsRequest.ts#L23-L64" }, { "kind": "response", @@ -110021,21 +109937,9 @@ "namespace": "cat._types" } } - }, - { - "description": "The unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } } ], - "specLocation": "cat/ml_datafeeds/CatDatafeedsRequest.ts#L24-L85" + "specLocation": "cat/ml_datafeeds/CatDatafeedsRequest.ts#L23-L80" }, { "kind": "response", @@ -111102,18 +111006,6 @@ } } }, - { - "description": "The unit used to display byte values.", - "name": "bytes", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Bytes", - "namespace": "_types" - } - } - }, { "description": "Comma-separated list of column names to display.", "name": "h", @@ -111138,21 +111030,9 @@ "namespace": "cat._types" } } - }, - { - "description": "The unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } } ], - "specLocation": "cat/ml_jobs/CatJobsRequest.ts#L24-L89" + "specLocation": "cat/ml_jobs/CatJobsRequest.ts#L23-L80" }, { "kind": "response", @@ -111257,18 +111137,6 @@ } } }, - { - "description": "The unit used to display byte values.", - "name": "bytes", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Bytes", - "namespace": "_types" - } - } - }, { "description": "A comma-separated list of column names to display.", "name": "h", @@ -111316,21 +111184,9 @@ "namespace": "_types" } } - }, - { - "description": "Unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } } ], - "specLocation": "cat/ml_trained_models/CatTrainedModelsRequest.ts#L25-L80" + "specLocation": "cat/ml_trained_models/CatTrainedModelsRequest.ts#L24-L73" }, { "kind": "response", @@ -113463,18 +113319,6 @@ }, "path": [], "query": [ - { - "description": "The unit used to display byte values.", - "name": "bytes", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Bytes", - "namespace": "_types" - } - } - }, { "description": "If `true`, return the full node ID. If `false`, return the shortened node ID.", "name": "full_id", @@ -113550,21 +113394,9 @@ "namespace": "_types" } } - }, - { - "description": "The unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } } ], - "specLocation": "cat/nodes/CatNodesRequest.ts#L24-L79" + "specLocation": "cat/nodes/CatNodesRequest.ts#L24-L71" }, { "kind": "response", @@ -113768,21 +113600,9 @@ "namespace": "_types" } } - }, - { - "description": "Unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } } ], - "specLocation": "cat/pending_tasks/CatPendingTasksRequest.ts#L24-L71" + "specLocation": "cat/pending_tasks/CatPendingTasksRequest.ts#L24-L67" }, { "kind": "response", @@ -114548,18 +114368,6 @@ } } }, - { - "description": "The unit used to display byte values.", - "name": "bytes", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Bytes", - "namespace": "_types" - } - } - }, { "description": "If `true`, the response includes detailed information about shard recoveries.", "name": "detailed", @@ -114609,21 +114417,9 @@ "namespace": "_types" } } - }, - { - "description": "The unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } } ], - "specLocation": "cat/recovery/CatRecoveryRequest.ts#L24-L92" + "specLocation": "cat/recovery/CatRecoveryRequest.ts#L23-L83" }, { "kind": "response", @@ -114896,18 +114692,6 @@ } ], "query": [ - { - "description": "The unit used to display byte values.", - "name": "bytes", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Bytes", - "namespace": "_types" - } - } - }, { "description": "A comma-separated list of columns names to display.\nIt supports simple wildcards.", "name": "h", @@ -114960,7 +114744,7 @@ } } ], - "specLocation": "cat/segments/CatSegmentsRequest.ts#L24-L87" + "specLocation": "cat/segments/CatSegmentsRequest.ts#L24-L83" }, { "kind": "response", @@ -115292,18 +115076,6 @@ } ], "query": [ - { - "description": "The unit used to display byte values.", - "name": "bytes", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "Bytes", - "namespace": "_types" - } - } - }, { "description": "List of columns to appear in the response. Supports simple wildcards.", "name": "h", @@ -115340,21 +115112,9 @@ "namespace": "_types" } } - }, - { - "description": "The unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } } ], - "specLocation": "cat/shards/CatShardsRequest.ts#L24-L81" + "specLocation": "cat/shards/CatShardsRequest.ts#L24-L73" }, { "kind": "response", @@ -116798,21 +116558,9 @@ "namespace": "_types" } } - }, - { - "description": "Unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } } ], - "specLocation": "cat/snapshots/CatSnapshotsRequest.ts#L24-L84" + "specLocation": "cat/snapshots/CatSnapshotsRequest.ts#L24-L80" }, { "kind": "response", @@ -117216,18 +116964,6 @@ } } }, - { - "description": "Unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } - }, { "description": "Period to wait for a response.\nIf no response is received before the timeout expires, the request fails and returns an error.", "name": "timeout", @@ -117255,7 +116991,7 @@ } } ], - "specLocation": "cat/tasks/CatTasksRequest.ts#L24-L82" + "specLocation": "cat/tasks/CatTasksRequest.ts#L24-L78" }, { "kind": "response", @@ -117858,18 +117594,6 @@ } } }, - { - "description": "The unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } - }, { "description": "If `true`, the request computes the list of selected nodes from the\nlocal cluster state. If `false` the list of selected nodes are computed\nfrom the cluster state of the master node. In both cases the coordinating\nnode will send requests for further information to each selected node.", "name": "local", @@ -117897,7 +117621,7 @@ } } ], - "specLocation": "cat/thread_pool/CatThreadPoolRequest.ts#L24-L83" + "specLocation": "cat/thread_pool/CatThreadPoolRequest.ts#L24-L79" }, { "kind": "response", @@ -118404,18 +118128,6 @@ } } }, - { - "description": "The unit used to display time values.", - "name": "time", - "required": false, - "type": { - "kind": "instance_of", - "type": { - "name": "TimeUnit", - "namespace": "_types" - } - } - }, { "description": "The maximum number of transforms to obtain.", "name": "size", @@ -118430,7 +118142,7 @@ } } ], - "specLocation": "cat/transforms/CatTransformsRequest.ts#L25-L89" + "specLocation": "cat/transforms/CatTransformsRequest.ts#L24-L84" }, { "kind": "response", @@ -248275,7 +247987,7 @@ "type": { "kind": "instance_of", "type": { - "name": "TimeUnit", + "name": "Duration", "namespace": "_types" } } @@ -248288,7 +248000,7 @@ "type": { "kind": "instance_of", "type": { - "name": "TimeUnit", + "name": "Duration", "namespace": "_types" } } @@ -248539,7 +248251,7 @@ "type": { "kind": "instance_of", "type": { - "name": "TimeUnit", + "name": "Duration", "namespace": "_types" } } @@ -248760,7 +248472,7 @@ "type": { "kind": "instance_of", "type": { - "name": "TimeUnit", + "name": "Duration", "namespace": "_types" } } @@ -248773,7 +248485,7 @@ "type": { "kind": "instance_of", "type": { - "name": "TimeUnit", + "name": "Duration", "namespace": "_types" } } @@ -276816,7 +276528,7 @@ "namespace": "_spec_utils" }, "properties": [], - "specLocation": "_spec_utils/behaviors.ts#L20-L28" + "specLocation": "_spec_utils/behaviors.ts#L23-L31" }, { "kind": "interface", @@ -276836,7 +276548,7 @@ "namespace": "_spec_utils" }, "properties": [], - "specLocation": "_spec_utils/behaviors.ts#L30-L39" + "specLocation": "_spec_utils/behaviors.ts#L33-L42" }, { "kind": "interface", @@ -276913,7 +276625,7 @@ } } ], - "specLocation": "_spec_utils/behaviors.ts#L41-L75" + "specLocation": "_spec_utils/behaviors.ts#L44-L78" }, { "kind": "interface", @@ -276929,7 +276641,7 @@ "namespace": "_spec_utils" }, "properties": [], - "specLocation": "_spec_utils/behaviors.ts#L102-L108" + "specLocation": "_spec_utils/behaviors.ts#L120-L126" }, { "kind": "interface", @@ -276977,9 +276689,33 @@ "namespace": "_builtins" } } + }, + { + "description": "Sets the units for columns that contain a byte-size value.\nNote that byte-size value units work in terms of powers of 1024. For instance `1kb` means 1024 bytes, not 1000 bytes.\nIf omitted, byte-size values are rendered with a suffix such as `kb`, `mb`, or `gb`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`.\nIf given, byte-size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit.\nValues that are not an exact multiple of the chosen unit are rounded down.", + "name": "bytes", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "Bytes", + "namespace": "_types" + } + } + }, + { + "description": "Sets the units for columns that contain a time duration.\nIf omitted, time duration values are rendered with a suffix such as `ms`, `s`, `m` or `h`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`.\nIf given, time duration values are rendered as an integer with no suffix.\nValues that are not an exact multiple of the chosen unit are rounded down.", + "name": "time", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "TimeUnit", + "namespace": "_types" + } + } } ], - "specLocation": "_spec_utils/behaviors.ts#L77-L100" + "specLocation": "_spec_utils/behaviors.ts#L80-L118" } ] } \ No newline at end of file diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 34717a8197..05256be8e3 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1,5 +1,121 @@ { "endpointErrors": { + "cat.aliases": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec", + "Request: query parameter 'time' does not exist in the json spec" + ], + "response": [] + }, + "cat.allocation": { + "request": [ + "Request: query parameter 'time' does not exist in the json spec" + ], + "response": [] + }, + "cat.component_templates": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec", + "Request: query parameter 'time' does not exist in the json spec" + ], + "response": [] + }, + "cat.count": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec", + "Request: query parameter 'time' does not exist in the json spec" + ], + "response": [] + }, + "cat.fielddata": { + "request": [ + "Request: query parameter 'time' does not exist in the json spec" + ], + "response": [] + }, + "cat.health": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec" + ], + "response": [] + }, + "cat.master": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec", + "Request: query parameter 'time' does not exist in the json spec" + ], + "response": [] + }, + "cat.ml_datafeeds": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec" + ], + "response": [] + }, + "cat.nodeattrs": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec", + "Request: query parameter 'time' does not exist in the json spec" + ], + "response": [] + }, + "cat.pending_tasks": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec" + ], + "response": [] + }, + "cat.plugins": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec", + "Request: query parameter 'time' does not exist in the json spec" + ], + "response": [] + }, + "cat.repositories": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec", + "Request: query parameter 'time' does not exist in the json spec" + ], + "response": [] + }, + "cat.segments": { + "request": [ + "Request: query parameter 'time' does not exist in the json spec" + ], + "response": [] + }, + "cat.snapshots": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec" + ], + "response": [] + }, + "cat.tasks": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec" + ], + "response": [] + }, + "cat.templates": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec", + "Request: query parameter 'time' does not exist in the json spec" + ], + "response": [] + }, + "cat.thread_pool": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec" + ], + "response": [] + }, + "cat.transforms": { + "request": [ + "Request: query parameter 'bytes' does not exist in the json spec" + ], + "response": [] + }, "streams.status": { "request": [ "Request: query parameter 'master_timeout' does not exist in the json spec", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index eb87db9c35..89e2736f04 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -7352,7 +7352,6 @@ export interface CatAllocationAllocationRecord { export interface CatAllocationRequest extends CatCatRequestBase { node_id?: NodeIds - bytes?: Bytes h?: CatCatAllocationColumns s?: Names local?: boolean @@ -7417,7 +7416,6 @@ export interface CatFielddataFielddataRecord { export interface CatFielddataRequest extends CatCatRequestBase { fields?: Fields - bytes?: Bytes h?: CatCatFieldDataColumns s?: Names } @@ -7478,7 +7476,6 @@ export interface CatHealthHealthRecord { } export interface CatHealthRequest extends CatCatRequestBase { - time?: TimeUnit ts?: boolean h?: CatCatHealthColumns s?: Names @@ -7785,12 +7782,10 @@ export interface CatIndicesIndicesRecord { export interface CatIndicesRequest extends CatCatRequestBase { index?: Indices - bytes?: Bytes expand_wildcards?: ExpandWildcards health?: HealthStatus include_unloaded_segments?: boolean pri?: boolean - time?: TimeUnit master_timeout?: Duration h?: CatCatIndicesColumns s?: Names @@ -7863,10 +7858,8 @@ export interface CatMlDataFrameAnalyticsDataFrameAnalyticsRecord { export interface CatMlDataFrameAnalyticsRequest extends CatCatRequestBase { id?: Id allow_no_match?: boolean - bytes?: Bytes h?: CatCatDfaColumns s?: CatCatDfaColumns - time?: TimeUnit } export type CatMlDataFrameAnalyticsResponse = CatMlDataFrameAnalyticsDataFrameAnalyticsRecord[] @@ -7911,7 +7904,6 @@ export interface CatMlDatafeedsRequest extends CatCatRequestBase { allow_no_match?: boolean h?: CatCatDatafeedColumns s?: CatCatDatafeedColumns - time?: TimeUnit } export type CatMlDatafeedsResponse = CatMlDatafeedsDatafeedsRecord[] @@ -8096,10 +8088,8 @@ export interface CatMlJobsJobsRecord { export interface CatMlJobsRequest extends CatCatRequestBase { job_id?: Id allow_no_match?: boolean - bytes?: Bytes h?: CatCatAnomalyDetectorColumns s?: CatCatAnomalyDetectorColumns - time?: TimeUnit } export type CatMlJobsResponse = CatMlJobsJobsRecord[] @@ -8107,12 +8097,10 @@ export type CatMlJobsResponse = CatMlJobsJobsRecord[] export interface CatMlTrainedModelsRequest extends CatCatRequestBase { model_id?: Id allow_no_match?: boolean - bytes?: Bytes h?: CatCatTrainedModelsColumns s?: CatCatTrainedModelsColumns from?: integer size?: integer - time?: TimeUnit } export type CatMlTrainedModelsResponse = CatMlTrainedModelsTrainedModelsRecord[] @@ -8459,13 +8447,11 @@ export interface CatNodesNodesRecord { } export interface CatNodesRequest extends CatCatRequestBase { - bytes?: Bytes full_id?: boolean | string include_unloaded_segments?: boolean h?: CatCatNodeColumns s?: Names master_timeout?: Duration - time?: TimeUnit } export type CatNodesResponse = CatNodesNodesRecord[] @@ -8486,7 +8472,6 @@ export interface CatPendingTasksRequest extends CatCatRequestBase { s?: Names local?: boolean master_timeout?: Duration - time?: TimeUnit } export type CatPendingTasksResponse = CatPendingTasksPendingTasksRecord[] @@ -8576,11 +8561,9 @@ export interface CatRecoveryRecoveryRecord { export interface CatRecoveryRequest extends CatCatRequestBase { index?: Indices active_only?: boolean - bytes?: Bytes detailed?: boolean h?: CatCatRecoveryColumns s?: Names - time?: TimeUnit } export type CatRecoveryResponse = CatRecoveryRecoveryRecord[] @@ -8603,7 +8586,6 @@ export type CatRepositoriesResponse = CatRepositoriesRepositoriesRecord[] export interface CatSegmentsRequest extends CatCatRequestBase { index?: Indices - bytes?: Bytes h?: CatCatSegmentsColumns s?: Names local?: boolean @@ -8656,11 +8638,9 @@ export interface CatSegmentsSegmentsRecord { export interface CatShardsRequest extends CatCatRequestBase { index?: Indices - bytes?: Bytes h?: CatCatShardColumns s?: Names master_timeout?: Duration - time?: TimeUnit } export type CatShardsResponse = CatShardsShardsRecord[] @@ -8886,7 +8866,6 @@ export interface CatSnapshotsRequest extends CatCatRequestBase { h?: CatCatSnapshotsColumns s?: Names master_timeout?: Duration - time?: TimeUnit } export type CatSnapshotsResponse = CatSnapshotsSnapshotsRecord[] @@ -8932,7 +8911,6 @@ export interface CatTasksRequest extends CatCatRequestBase { parent_task_id?: string h?: CatCatTasksColumns s?: Names - time?: TimeUnit timeout?: Duration wait_for_completion?: boolean } @@ -9002,7 +8980,6 @@ export interface CatThreadPoolRequest extends CatCatRequestBase { thread_pool_patterns?: Names h?: CatCatThreadPoolColumns s?: Names - time?: TimeUnit local?: boolean master_timeout?: Duration } @@ -9058,7 +9035,6 @@ export interface CatTransformsRequest extends CatCatRequestBase { from?: integer h?: CatCatTransformColumns s?: CatCatTransformColumns - time?: TimeUnit size?: integer } @@ -21155,8 +21131,8 @@ export type ShutdownType = 'restart' | 'remove' | 'replace' export interface ShutdownDeleteNodeRequest extends RequestBase { node_id: NodeId - master_timeout?: TimeUnit - timeout?: TimeUnit + master_timeout?: Duration + timeout?: Duration } export type ShutdownDeleteNodeResponse = AcknowledgedResponseBase @@ -21182,7 +21158,7 @@ export interface ShutdownGetNodePluginsStatus { export interface ShutdownGetNodeRequest extends RequestBase { node_id?: NodeIds - master_timeout?: TimeUnit + master_timeout?: Duration } export interface ShutdownGetNodeResponse { @@ -21199,8 +21175,8 @@ export type ShutdownGetNodeShutdownType = 'remove' | 'restart' export interface ShutdownPutNodeRequest extends RequestBase { node_id: NodeId - master_timeout?: TimeUnit - timeout?: TimeUnit + master_timeout?: Duration + timeout?: Duration body?: { type: ShutdownType reason: string @@ -23930,5 +23906,7 @@ export interface SpecUtilsCommonCatQueryParameters { format?: string help?: boolean v?: boolean + bytes?: Bytes + time?: TimeUnit } diff --git a/specification/_spec_utils/behaviors.ts b/specification/_spec_utils/behaviors.ts index 2ca26df4db..d6542e6c41 100644 --- a/specification/_spec_utils/behaviors.ts +++ b/specification/_spec_utils/behaviors.ts @@ -17,6 +17,9 @@ * under the License. */ +import { Bytes } from '@_types/common' +import { TimeUnit } from '@_types/Time' + /** * In some places in the specification an object consists of the union of a set of known properties * and a set of runtime injected properties. Meaning that object should theoretically extend Dictionary but expose @@ -97,6 +100,21 @@ export interface CommonCatQueryParameters { * @server_default false */ v?: boolean + /** + * Sets the units for columns that contain a byte-size value. + * Note that byte-size value units work in terms of powers of 1024. For instance `1kb` means 1024 bytes, not 1000 bytes. + * If omitted, byte-size values are rendered with a suffix such as `kb`, `mb`, or `gb`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`. + * If given, byte-size values are rendered as an integer with no suffix, representing the value of the column in the chosen unit. + * Values that are not an exact multiple of the chosen unit are rounded down. + */ + bytes?: Bytes + /** + * Sets the units for columns that contain a time duration. + * If omitted, time duration values are rendered with a suffix such as `ms`, `s`, `m` or `h`, chosen such that the numeric value of the column is as small as possible whilst still being at least `1.0`. + * If given, time duration values are rendered as an integer with no suffix. + * Values that are not an exact multiple of the chosen unit are rounded down. + */ + time?: TimeUnit } /** diff --git a/specification/cat/allocation/CatAllocationRequest.ts b/specification/cat/allocation/CatAllocationRequest.ts index 0bec053b71..559ab8f238 100644 --- a/specification/cat/allocation/CatAllocationRequest.ts +++ b/specification/cat/allocation/CatAllocationRequest.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Bytes, Names, NodeIds } from '@_types/common' +import { Names, NodeIds } from '@_types/common' import { Duration } from '@_types/Time' import { CatAllocationColumns, CatRequestBase } from '@cat/_types/CatBase' @@ -49,8 +49,6 @@ export interface Request extends CatRequestBase { node_id?: NodeIds } query_parameters: { - /** The unit used to display byte values. */ - bytes?: Bytes /** * A comma-separated list of columns names to display. It supports simple wildcards. */ diff --git a/specification/cat/fielddata/CatFielddataRequest.ts b/specification/cat/fielddata/CatFielddataRequest.ts index c88438f3a7..5cf2f58b39 100644 --- a/specification/cat/fielddata/CatFielddataRequest.ts +++ b/specification/cat/fielddata/CatFielddataRequest.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Bytes, Fields, Names } from '@_types/common' +import { Fields, Names } from '@_types/common' import { CatFieldDataColumns, CatRequestBase } from '@cat/_types/CatBase' /** @@ -52,8 +52,6 @@ export interface Request extends CatRequestBase { fields?: Fields } query_parameters: { - /** The unit used to display byte values. */ - bytes?: Bytes /** Comma-separated list of fields used to limit returned information. */ fields?: Fields /** diff --git a/specification/cat/health/CatHealthRequest.ts b/specification/cat/health/CatHealthRequest.ts index 8d5b200b90..e2d25331ee 100644 --- a/specification/cat/health/CatHealthRequest.ts +++ b/specification/cat/health/CatHealthRequest.ts @@ -18,7 +18,6 @@ */ import { Names } from '@_types/common' -import { TimeUnit } from '@_types/Time' import { CatHealthColumns, CatRequestBase } from '@cat/_types/CatBase' /** @@ -47,10 +46,6 @@ export interface Request extends CatRequestBase { } ] query_parameters: { - /** - * The unit used to display time values. - */ - time?: TimeUnit /** * If true, returns `HH:MM:SS` and Unix epoch timestamps. * @server_default true diff --git a/specification/cat/indices/CatIndicesRequest.ts b/specification/cat/indices/CatIndicesRequest.ts index 3604be33da..f0f181d1b2 100644 --- a/specification/cat/indices/CatIndicesRequest.ts +++ b/specification/cat/indices/CatIndicesRequest.ts @@ -17,14 +17,8 @@ * under the License. */ -import { - Bytes, - ExpandWildcards, - HealthStatus, - Indices, - Names -} from '@_types/common' -import { Duration, TimeUnit } from '@_types/Time' +import { ExpandWildcards, HealthStatus, Indices, Names } from '@_types/common' +import { Duration } from '@_types/Time' import { CatIndicesColumns, CatRequestBase } from '@cat/_types/CatBase' /** @@ -70,8 +64,6 @@ export interface Request extends CatRequestBase { index?: Indices } query_parameters: { - /** The unit used to display byte values. */ - bytes?: Bytes /** * The type of index that wildcard patterns can match. */ @@ -88,8 +80,6 @@ export interface Request extends CatRequestBase { * @server_default false */ pri?: boolean - /** The unit used to display time values. */ - time?: TimeUnit /** * Period to wait for a connection to the master node. * @server_default 30s diff --git a/specification/cat/ml_data_frame_analytics/CatDataFrameAnalyticsRequest.ts b/specification/cat/ml_data_frame_analytics/CatDataFrameAnalyticsRequest.ts index 0493849437..fd2183fa6e 100644 --- a/specification/cat/ml_data_frame_analytics/CatDataFrameAnalyticsRequest.ts +++ b/specification/cat/ml_data_frame_analytics/CatDataFrameAnalyticsRequest.ts @@ -17,8 +17,7 @@ * under the License. */ -import { Bytes, Id } from '@_types/common' -import { TimeUnit } from '@_types/Time' +import { Id } from '@_types/common' import { CatDfaColumns, CatRequestBase } from '@cat/_types/CatBase' /** @@ -52,7 +51,6 @@ export interface Request extends CatRequestBase { } query_parameters: { allow_no_match?: boolean - bytes?: Bytes /** * Comma-separated list of column names to display. * @server_default create_time,id,state,type @@ -62,9 +60,5 @@ export interface Request extends CatRequestBase { * response. */ s?: CatDfaColumns - /** - * Unit used to display time values. - */ - time?: TimeUnit } } diff --git a/specification/cat/ml_datafeeds/CatDatafeedsRequest.ts b/specification/cat/ml_datafeeds/CatDatafeedsRequest.ts index a52925c415..c7628c2aa8 100644 --- a/specification/cat/ml_datafeeds/CatDatafeedsRequest.ts +++ b/specification/cat/ml_datafeeds/CatDatafeedsRequest.ts @@ -18,7 +18,6 @@ */ import { Id } from '@_types/common' -import { TimeUnit } from '@_types/Time' import { CatDatafeedColumns, CatRequestBase } from '@cat/_types/CatBase' /** @@ -77,9 +76,5 @@ export interface Request extends CatRequestBase { h?: CatDatafeedColumns /** Comma-separated list of column names or column aliases used to sort the response. */ s?: CatDatafeedColumns - /** - * The unit used to display time values. - */ - time?: TimeUnit } } diff --git a/specification/cat/ml_jobs/CatJobsRequest.ts b/specification/cat/ml_jobs/CatJobsRequest.ts index e9c0eb1344..34e4d543fc 100644 --- a/specification/cat/ml_jobs/CatJobsRequest.ts +++ b/specification/cat/ml_jobs/CatJobsRequest.ts @@ -17,8 +17,7 @@ * under the License. */ -import { Bytes, Id } from '@_types/common' -import { TimeUnit } from '@_types/Time' +import { Id } from '@_types/common' import { CatAnomalyDetectorColumns, CatRequestBase } from '@cat/_types/CatBase' /** @@ -70,10 +69,6 @@ export interface Request extends CatRequestBase { * @server_default true */ allow_no_match?: boolean - /** - * The unit used to display byte values. - */ - bytes?: Bytes /** * Comma-separated list of column names to display. * @server_default buckets.count,data.processed_records,forecasts.total,id,model.bytes,model.memory_status,state @@ -81,9 +76,5 @@ export interface Request extends CatRequestBase { h?: CatAnomalyDetectorColumns /** Comma-separated list of column names or column aliases used to sort the response. */ s?: CatAnomalyDetectorColumns - /** - * The unit used to display time values. - */ - time?: TimeUnit } } diff --git a/specification/cat/ml_trained_models/CatTrainedModelsRequest.ts b/specification/cat/ml_trained_models/CatTrainedModelsRequest.ts index 1d6b2635ea..a91198199e 100644 --- a/specification/cat/ml_trained_models/CatTrainedModelsRequest.ts +++ b/specification/cat/ml_trained_models/CatTrainedModelsRequest.ts @@ -17,9 +17,8 @@ * under the License. */ -import { Bytes, Id } from '@_types/common' +import { Id } from '@_types/common' import { integer } from '@_types/Numeric' -import { TimeUnit } from '@_types/Time' import { CatRequestBase, CatTrainedModelsColumns } from '@cat/_types/CatBase' /** @@ -62,8 +61,6 @@ export interface Request extends CatRequestBase { * @server_default true */ allow_no_match?: boolean - /** The unit used to display byte values. */ - bytes?: Bytes /** A comma-separated list of column names to display. */ h?: CatTrainedModelsColumns /** A comma-separated list of column names or aliases used to sort the response. */ @@ -72,9 +69,5 @@ export interface Request extends CatRequestBase { from?: integer /** The maximum number of transforms to display. */ size?: integer - /** - * Unit used to display time values. - */ - time?: TimeUnit } } diff --git a/specification/cat/nodes/CatNodesRequest.ts b/specification/cat/nodes/CatNodesRequest.ts index 4118521222..86a1905270 100644 --- a/specification/cat/nodes/CatNodesRequest.ts +++ b/specification/cat/nodes/CatNodesRequest.ts @@ -17,8 +17,8 @@ * under the License. */ -import { Bytes, Names } from '@_types/common' -import { Duration, TimeUnit } from '@_types/Time' +import { Names } from '@_types/common' +import { Duration } from '@_types/Time' import { CatNodeColumns, CatRequestBase } from '@cat/_types/CatBase' /** @@ -40,10 +40,6 @@ export interface Request extends CatRequestBase { } ] query_parameters: { - /** - * The unit used to display byte values. - */ - bytes?: Bytes /** * If `true`, return the full node ID. If `false`, return the shortened node ID. * @server_default false @@ -71,9 +67,5 @@ export interface Request extends CatRequestBase { * @server_default 30s */ master_timeout?: Duration - /** - * The unit used to display time values. - */ - time?: TimeUnit } } diff --git a/specification/cat/pending_tasks/CatPendingTasksRequest.ts b/specification/cat/pending_tasks/CatPendingTasksRequest.ts index b49dd64921..80eb0494b7 100644 --- a/specification/cat/pending_tasks/CatPendingTasksRequest.ts +++ b/specification/cat/pending_tasks/CatPendingTasksRequest.ts @@ -18,7 +18,7 @@ */ import { Names } from '@_types/common' -import { Duration, TimeUnit } from '@_types/Time' +import { Duration } from '@_types/Time' import { CatPendingTasksColumns, CatRequestBase } from '@cat/_types/CatBase' /** @@ -63,9 +63,5 @@ export interface Request extends CatRequestBase { * @server_default 30s */ master_timeout?: Duration - /** - * Unit used to display time values. - */ - time?: TimeUnit } } diff --git a/specification/cat/recovery/CatRecoveryRequest.ts b/specification/cat/recovery/CatRecoveryRequest.ts index 6ee0ebb8c5..0ffa203307 100644 --- a/specification/cat/recovery/CatRecoveryRequest.ts +++ b/specification/cat/recovery/CatRecoveryRequest.ts @@ -17,8 +17,7 @@ * under the License. */ -import { Bytes, Indices, Names } from '@_types/common' -import { TimeUnit } from '@_types/Time' +import { Indices, Names } from '@_types/common' import { CatRecoveryColumns, CatRequestBase } from '@cat/_types/CatBase' /** @@ -59,10 +58,6 @@ export interface Request extends CatRequestBase { * @server_default false */ active_only?: boolean - /** - * The unit used to display byte values. - */ - bytes?: Bytes /** * If `true`, the response includes detailed information about shard recoveries. * @server_default false @@ -84,9 +79,5 @@ export interface Request extends CatRequestBase { * or `:desc` as a suffix to the column name. */ s?: Names - /** - * The unit used to display time values. - */ - time?: TimeUnit } } diff --git a/specification/cat/segments/CatSegmentsRequest.ts b/specification/cat/segments/CatSegmentsRequest.ts index 9bdb64e5c0..d8d18f0858 100644 --- a/specification/cat/segments/CatSegmentsRequest.ts +++ b/specification/cat/segments/CatSegmentsRequest.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Bytes, Indices, Names } from '@_types/common' +import { Indices, Names } from '@_types/common' import { Duration } from '@_types/Time' import { CatRequestBase, CatSegmentsColumns } from '@cat/_types/CatBase' @@ -54,10 +54,6 @@ export interface Request extends CatRequestBase { index?: Indices } query_parameters: { - /** - * The unit used to display byte values. - */ - bytes?: Bytes /** * A comma-separated list of columns names to display. * It supports simple wildcards. diff --git a/specification/cat/shards/CatShardsRequest.ts b/specification/cat/shards/CatShardsRequest.ts index dd3aa69801..2aef08af36 100644 --- a/specification/cat/shards/CatShardsRequest.ts +++ b/specification/cat/shards/CatShardsRequest.ts @@ -17,8 +17,8 @@ * under the License. */ -import { Bytes, Indices, Names } from '@_types/common' -import { Duration, TimeUnit } from '@_types/Time' +import { Indices, Names } from '@_types/common' +import { Duration } from '@_types/Time' import { CatRequestBase, CatShardColumns } from '@cat/_types/CatBase' /** @@ -54,10 +54,6 @@ export interface Request extends CatRequestBase { index?: Indices } query_parameters: { - /** - * The unit used to display byte values. - */ - bytes?: Bytes /** * List of columns to appear in the response. Supports simple wildcards. */ @@ -73,9 +69,5 @@ export interface Request extends CatRequestBase { * @server_default 30s */ master_timeout?: Duration - /** - * The unit used to display time values. - */ - time?: TimeUnit } } diff --git a/specification/cat/snapshots/CatSnapshotsRequest.ts b/specification/cat/snapshots/CatSnapshotsRequest.ts index 7d0461353e..28f230f617 100644 --- a/specification/cat/snapshots/CatSnapshotsRequest.ts +++ b/specification/cat/snapshots/CatSnapshotsRequest.ts @@ -18,7 +18,7 @@ */ import { Names } from '@_types/common' -import { Duration, TimeUnit } from '@_types/Time' +import { Duration } from '@_types/Time' import { CatRequestBase, CatSnapshotsColumns } from '@cat/_types/CatBase' /** @@ -76,9 +76,5 @@ export interface Request extends CatRequestBase { * @server_default 30s */ master_timeout?: Duration - /** - * Unit used to display time values. - */ - time?: TimeUnit } } diff --git a/specification/cat/tasks/CatTasksRequest.ts b/specification/cat/tasks/CatTasksRequest.ts index b9ef1df77f..e956aed1d0 100644 --- a/specification/cat/tasks/CatTasksRequest.ts +++ b/specification/cat/tasks/CatTasksRequest.ts @@ -18,7 +18,7 @@ */ import { Names } from '@_types/common' -import { Duration, TimeUnit } from '@_types/Time' +import { Duration } from '@_types/Time' import { CatRequestBase, CatTasksColumns } from '@cat/_types/CatBase' /** @@ -63,10 +63,6 @@ export interface Request extends CatRequestBase { * or `:desc` as a suffix to the column name. */ s?: Names - /** - * Unit used to display time values. - */ - time?: TimeUnit /** * Period to wait for a response. * If no response is received before the timeout expires, the request fails and returns an error. diff --git a/specification/cat/thread_pool/CatThreadPoolRequest.ts b/specification/cat/thread_pool/CatThreadPoolRequest.ts index 6acf6b5f3d..f83d447f53 100644 --- a/specification/cat/thread_pool/CatThreadPoolRequest.ts +++ b/specification/cat/thread_pool/CatThreadPoolRequest.ts @@ -18,7 +18,7 @@ */ import { Names } from '@_types/common' -import { Duration, TimeUnit } from '@_types/Time' +import { Duration } from '@_types/Time' import { CatRequestBase, CatThreadPoolColumns } from '@cat/_types/CatBase' /** @@ -62,10 +62,6 @@ export interface Request extends CatRequestBase { * or `:desc` as a suffix to the column name. */ s?: Names - /** - * 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 diff --git a/specification/cat/transforms/CatTransformsRequest.ts b/specification/cat/transforms/CatTransformsRequest.ts index f4e9bcbdfb..5d8b01947c 100644 --- a/specification/cat/transforms/CatTransformsRequest.ts +++ b/specification/cat/transforms/CatTransformsRequest.ts @@ -19,7 +19,6 @@ import { Id } from '@_types/common' import { integer } from '@_types/Numeric' -import { TimeUnit } from '@_types/Time' import { CatRequestBase, CatTransformColumns } from '@cat/_types/CatBase' /** @@ -76,10 +75,6 @@ export interface Request extends CatRequestBase { /** Comma-separated list of column names or column aliases used to sort the response. */ s?: CatTransformColumns - /** - * The unit used to display time values. - */ - time?: TimeUnit /** * The maximum number of transforms to obtain. * @server_default 100 diff --git a/specification/shutdown/delete_node/ShutdownDeleteNodeRequest.ts b/specification/shutdown/delete_node/ShutdownDeleteNodeRequest.ts index bcd8c633c6..6828edce69 100644 --- a/specification/shutdown/delete_node/ShutdownDeleteNodeRequest.ts +++ b/specification/shutdown/delete_node/ShutdownDeleteNodeRequest.ts @@ -19,7 +19,7 @@ import { RequestBase } from '@_types/Base' import { NodeId } from '@_types/common' -import { TimeUnit } from '@_types/Time' +import { Duration } from '@_types/Time' /** * Cancel node shutdown preparations. @@ -51,11 +51,11 @@ export interface Request extends RequestBase { * 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?: TimeUnit + 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?: TimeUnit + timeout?: Duration } } diff --git a/specification/shutdown/get_node/ShutdownGetNodeRequest.ts b/specification/shutdown/get_node/ShutdownGetNodeRequest.ts index 46ba2dc1a9..811baaff50 100644 --- a/specification/shutdown/get_node/ShutdownGetNodeRequest.ts +++ b/specification/shutdown/get_node/ShutdownGetNodeRequest.ts @@ -19,7 +19,7 @@ import { RequestBase } from '@_types/Base' import { NodeIds } from '@_types/common' -import { TimeUnit } from '@_types/Time' +import { Duration } from '@_types/Time' /** * Get the shutdown status. @@ -54,6 +54,6 @@ export interface Request extends RequestBase { * 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?: TimeUnit + master_timeout?: Duration } } diff --git a/specification/shutdown/put_node/ShutdownPutNodeRequest.ts b/specification/shutdown/put_node/ShutdownPutNodeRequest.ts index 12cee1aba8..c178209373 100644 --- a/specification/shutdown/put_node/ShutdownPutNodeRequest.ts +++ b/specification/shutdown/put_node/ShutdownPutNodeRequest.ts @@ -19,7 +19,7 @@ import { RequestBase } from '@_types/Base' import { NodeId } from '@_types/common' -import { TimeUnit } from '@_types/Time' +import { Duration } from '@_types/Time' import { Type } from '../_types/types' /** @@ -66,13 +66,13 @@ export interface Request extends RequestBase { * If no response is received before the timeout expires, the request fails and returns an error. * @server_default 30s */ - master_timeout?: TimeUnit + master_timeout?: Duration /** * The 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?: TimeUnit + timeout?: Duration } body: { /** From 890c7673126dff8ca75933d5da1128977a0b20a9 Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 17 Sep 2025 09:42:59 -0700 Subject: [PATCH 19/26] Edit the log streams endpoint docs (#5305) --- output/schema/schema.json | 15 ++++++++------- .../logs_disable/StreamsLogsDisableRequest.ts | 4 ++-- .../logs_enable/StreamsLogsEnableRequest.ts | 10 +++++----- .../streams/status/StreamsStatusRequest.ts | 4 ++-- .../streams/status/StreamsStatusResponse.ts | 3 +++ 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index 82754bc9d3..a02a7ba70c 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -22616,7 +22616,7 @@ "visibility": "feature_flag" } }, - "description": "Disable logs stream\n\nThis disables the logs stream feature for this cluster.", + "description": "Disable logs stream.\n\nTurn off the logs stream feature for this cluster.", "docId": "streams-logs-disable", "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.logs_disable", @@ -22656,7 +22656,7 @@ "visibility": "feature_flag" } }, - "description": "Enable logs stream\n\nThis enables the logs stream feature for this cluster.\n\nNote: To protect existing data, this feature can only be enabled on a cluster if\nit does not have existing indices or data streams matching the pattern `logs|logs.*`.\nIf this is the case, a `409 - Conflict` response and error will be returned.", + "description": "Enable logs stream.\n\nTurn on the logs stream feature for this cluster.\n\nNOTE: To protect existing data, this feature can be turned on only if the\ncluster does not have existing indices or data streams that match the pattern `logs|logs.*`.\nIf those indices or data streams exist, a `409 - Conflict` response and error is returned.", "docId": "streams-logs-enable", "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.logs_enable", @@ -22696,7 +22696,7 @@ "visibility": "feature_flag" } }, - "description": "Get the status of streams\n\nGets the current status of all stream types", + "description": "Get the status of streams.\n\nGet the current status for all types of streams.", "docId": "streams-status", "docUrl": "https://www.elastic.co/docs/api/doc/elasticsearch#TODO", "name": "streams.status", @@ -257984,7 +257984,7 @@ "body": { "kind": "no_body" }, - "description": "Disable logs stream\n\nThis disables the logs stream feature for this cluster.", + "description": "Disable logs stream.\n\nTurn off the logs stream feature for this cluster.", "examples": { "PostStreamsDisableRequestExample1": { "method_request": "POST _streams/logs/_disable", @@ -258066,7 +258066,7 @@ "body": { "kind": "no_body" }, - "description": "Enable logs stream\n\nThis enables the logs stream feature for this cluster.\n\nNote: To protect existing data, this feature can only be enabled on a cluster if\nit does not have existing indices or data streams matching the pattern `logs|logs.*`.\nIf this is the case, a `409 - Conflict` response and error will be returned.", + "description": "Enable logs stream.\n\nTurn on the logs stream feature for this cluster.\n\nNOTE: To protect existing data, this feature can be turned on only if the\ncluster does not have existing indices or data streams that match the pattern `logs|logs.*`.\nIf those indices or data streams exist, a `409 - Conflict` response and error is returned.", "examples": { "PostStreamsEnableRequestExample1": { "method_request": "POST _streams/logs/_enable", @@ -258148,6 +258148,7 @@ }, "properties": [ { + "description": "If true, the logs stream feature is enabled.", "name": "enabled", "required": true, "type": { @@ -258159,7 +258160,7 @@ } } ], - "specLocation": "streams/status/StreamsStatusResponse.ts#L26-L28" + "specLocation": "streams/status/StreamsStatusResponse.ts#L26-L31" }, { "kind": "request", @@ -258169,7 +258170,7 @@ "body": { "kind": "no_body" }, - "description": "Get the status of streams\n\nGets the current status of all stream types", + "description": "Get the status of streams.\n\nGet the current status for all types of streams.", "examples": { "GetStreamsStatusRequestExample1": { "method_request": "GET _streams/status", diff --git a/specification/streams/logs_disable/StreamsLogsDisableRequest.ts b/specification/streams/logs_disable/StreamsLogsDisableRequest.ts index 85bf71a197..c44e6060cb 100644 --- a/specification/streams/logs_disable/StreamsLogsDisableRequest.ts +++ b/specification/streams/logs_disable/StreamsLogsDisableRequest.ts @@ -21,9 +21,9 @@ import { RequestBase } from '@_types/Base' import { Duration } from '@_types/Time' /** - * Disable logs stream + * Disable logs stream. * - * This disables the logs stream feature for this cluster. + * Turn off the logs stream feature for this cluster. * @rest_spec_name streams.logs_disable * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream * @cluster_privileges manage diff --git a/specification/streams/logs_enable/StreamsLogsEnableRequest.ts b/specification/streams/logs_enable/StreamsLogsEnableRequest.ts index 43b5948b88..71915b4446 100644 --- a/specification/streams/logs_enable/StreamsLogsEnableRequest.ts +++ b/specification/streams/logs_enable/StreamsLogsEnableRequest.ts @@ -21,13 +21,13 @@ import { RequestBase } from '@_types/Base' import { Duration } from '@_types/Time' /** - * Enable logs stream + * Enable logs stream. * - * This enables the logs stream feature for this cluster. + * Turn on the logs stream feature for this cluster. * - * Note: To protect existing data, this feature can only be enabled on a cluster if - * it does not have existing indices or data streams matching the pattern `logs|logs.*`. - * If this is the case, a `409 - Conflict` response and error will be returned. + * NOTE: To protect existing data, this feature can be turned on only if the + * cluster does not have existing indices or data streams that match the pattern `logs|logs.*`. + * If those indices or data streams exist, a `409 - Conflict` response and error is returned. * @rest_spec_name streams.logs_enable * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream * @cluster_privileges manage diff --git a/specification/streams/status/StreamsStatusRequest.ts b/specification/streams/status/StreamsStatusRequest.ts index db6883d95b..e3877e030c 100644 --- a/specification/streams/status/StreamsStatusRequest.ts +++ b/specification/streams/status/StreamsStatusRequest.ts @@ -21,9 +21,9 @@ import { RequestBase } from '@_types/Base' import { TimeUnit } from '@_types/Time' /** - * Get the status of streams + * Get the status of streams. * - * Gets the current status of all stream types + * Get the current status for all types of streams. * @rest_spec_name streams.status * @availability stack since=9.1.0 stability=experimental visibility=feature_flag feature_flag=logs_stream * @cluster_privileges monitor diff --git a/specification/streams/status/StreamsStatusResponse.ts b/specification/streams/status/StreamsStatusResponse.ts index c5eb318485..ccc7f8d957 100644 --- a/specification/streams/status/StreamsStatusResponse.ts +++ b/specification/streams/status/StreamsStatusResponse.ts @@ -24,5 +24,8 @@ export class Response { } export class LogsStatus { + /** + * If true, the logs stream feature is enabled. + */ enabled: boolean } From 6445491702ed089aaad7e8e118bf4d6dc7778261 Mon Sep 17 00:00:00 2001 From: Mayya Sharipova Date: Thu, 18 Sep 2025 00:30:51 -0400 Subject: [PATCH 20/26] Add speficaiton for a new rescore type (#5308) Based on PR https://github.com/elastic/elasticsearch/pull/74274 --- specification/_global/search/_types/rescoring.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/specification/_global/search/_types/rescoring.ts b/specification/_global/search/_types/rescoring.ts index ede27346ed..9931b55225 100644 --- a/specification/_global/search/_types/rescoring.ts +++ b/specification/_global/search/_types/rescoring.ts @@ -19,6 +19,7 @@ import { double, integer } from '@_types/Numeric' import { QueryContainer } from '@_types/query_dsl/abstractions' +import { Script } from '@_types/Scripting' import { Dictionary } from '@spec_utils/Dictionary' import { UserDefinedValue } from '@spec_utils/UserDefinedValue' @@ -35,6 +36,8 @@ export class Rescore { query?: RescoreQuery learning_to_rank?: LearningToRank + + script?: ScriptRescore } export class RescoreQuery { @@ -95,3 +98,7 @@ export class LearningToRank { */ params?: Dictionary } + +export class ScriptRescore { + script: Script +} From 95e241a93b1d6886d8aa6258649dd93b7e863b56 Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Thu, 18 Sep 2025 04:32:01 +0000 Subject: [PATCH 21/26] Update specification output --- output/openapi/elasticsearch-openapi.json | 22 ++++++++++ .../elasticsearch-serverless-openapi.json | 22 ++++++++++ output/schema/schema.json | 40 +++++++++++++++++-- output/typescript/types.ts | 5 +++ 4 files changed, 85 insertions(+), 4 deletions(-) diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 4245b1d855..43a46ee1a0 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -62493,6 +62493,13 @@ "$ref": "#/components/schemas/_global.search._types.LearningToRank" } ] + }, + "script": { + "allOf": [ + { + "$ref": "#/components/schemas/_global.search._types.ScriptRescore" + } + ] } }, "minProperties": 1, @@ -62564,6 +62571,21 @@ "model_id" ] }, + "_global.search._types.ScriptRescore": { + "type": "object", + "properties": { + "script": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.Script" + } + ] + } + }, + "required": [ + "script" + ] + }, "_types.RetrieverContainer": { "type": "object", "properties": { diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index aa7653efe9..5d9b9cf445 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -38738,6 +38738,13 @@ "$ref": "#/components/schemas/_global.search._types.LearningToRank" } ] + }, + "script": { + "allOf": [ + { + "$ref": "#/components/schemas/_global.search._types.ScriptRescore" + } + ] } }, "minProperties": 1, @@ -38809,6 +38816,21 @@ "model_id" ] }, + "_global.search._types.ScriptRescore": { + "type": "object", + "properties": { + "script": { + "allOf": [ + { + "$ref": "#/components/schemas/_types.Script" + } + ] + } + }, + "required": [ + "script" + ] + }, "_types.RetrieverContainer": { "type": "object", "properties": { diff --git a/output/schema/schema.json b/output/schema/schema.json index a02a7ba70c..cddcc91637 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -42998,7 +42998,7 @@ } } ], - "specLocation": "_global/search/_types/rescoring.ts#L88-L97" + "specLocation": "_global/search/_types/rescoring.ts#L91-L100" }, { "kind": "interface", @@ -43933,9 +43933,20 @@ "namespace": "_global.search._types" } } + }, + { + "name": "script", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "ScriptRescore", + "namespace": "_global.search._types" + } + } } ], - "specLocation": "_global/search/_types/rescoring.ts#L25-L38", + "specLocation": "_global/search/_types/rescoring.ts#L26-L41", "variants": { "kind": "container", "nonExhaustive": true @@ -44001,7 +44012,7 @@ } } ], - "specLocation": "_global/search/_types/rescoring.ts#L40-L62" + "specLocation": "_global/search/_types/rescoring.ts#L43-L65" }, { "kind": "enum", @@ -44031,7 +44042,28 @@ "name": "ScoreMode", "namespace": "_global.search._types" }, - "specLocation": "_global/search/_types/rescoring.ts#L64-L86" + "specLocation": "_global/search/_types/rescoring.ts#L67-L89" + }, + { + "kind": "interface", + "name": { + "name": "ScriptRescore", + "namespace": "_global.search._types" + }, + "properties": [ + { + "name": "script", + "required": true, + "type": { + "kind": "instance_of", + "type": { + "name": "Script", + "namespace": "_types" + } + } + } + ], + "specLocation": "_global/search/_types/rescoring.ts#L102-L104" }, { "kind": "interface", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 89e2736f04..1a46d6f8f0 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -1684,6 +1684,7 @@ export interface SearchRescore { window_size?: integer query?: SearchRescoreQuery learning_to_rank?: SearchLearningToRank + script?: SearchScriptRescore } export interface SearchRescoreQuery { @@ -1695,6 +1696,10 @@ export interface SearchRescoreQuery { export type SearchScoreMode = 'avg' | 'max' | 'min' | 'multiply' | 'total' +export interface SearchScriptRescore { + script: Script | ScriptSource +} + export interface SearchSearchProfile { collector: SearchCollector[] query: SearchQueryProfile[] From 1f4968a0b3ed46d25f6a818d67c2b2a9ff3ac8b3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 11:06:23 +0400 Subject: [PATCH 22/26] Update rest-api-spec (#5294) Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com> --- .../_json_spec/_internal.delete_desired_balance.json | 1 + .../_json_spec/_internal.delete_desired_nodes.json | 1 + .../_json_spec/_internal.get_desired_balance.json | 1 + .../_internal.prevalidate_node_removal.json | 1 + .../autoscaling.delete_autoscaling_policy.json | 1 + .../autoscaling.get_autoscaling_capacity.json | 1 + .../autoscaling.get_autoscaling_policy.json | 1 + .../autoscaling.put_autoscaling_policy.json | 1 + specification/_json_spec/cat.aliases.json | 4 ++-- specification/_json_spec/cat.allocation.json | 1 + .../_json_spec/cat.component_templates.json | 1 + specification/_json_spec/cat.indices.json | 1 + specification/_json_spec/cat.master.json | 1 + .../_json_spec/cat.ml_data_frame_analytics.json | 1 - specification/_json_spec/cat.ml_datafeeds.json | 1 - specification/_json_spec/cat.ml_jobs.json | 1 - specification/_json_spec/cat.ml_trained_models.json | 1 - specification/_json_spec/cat.nodeattrs.json | 1 + specification/_json_spec/cat.nodes.json | 1 + specification/_json_spec/cat.pending_tasks.json | 1 + specification/_json_spec/cat.plugins.json | 1 + specification/_json_spec/cat.repositories.json | 1 + specification/_json_spec/cat.segments.json | 1 + specification/_json_spec/cat.shards.json | 1 + specification/_json_spec/cat.snapshots.json | 1 + specification/_json_spec/cat.templates.json | 1 + specification/_json_spec/cat.thread_pool.json | 1 + specification/_json_spec/cat.transforms.json | 3 --- .../_json_spec/ccr.delete_auto_follow_pattern.json | 1 + specification/_json_spec/ccr.follow.json | 1 + specification/_json_spec/ccr.follow_info.json | 1 + .../_json_spec/ccr.get_auto_follow_pattern.json | 1 + .../_json_spec/ccr.pause_auto_follow_pattern.json | 1 + specification/_json_spec/ccr.pause_follow.json | 1 + .../_json_spec/ccr.put_auto_follow_pattern.json | 1 + .../_json_spec/ccr.resume_auto_follow_pattern.json | 1 + specification/_json_spec/ccr.resume_follow.json | 1 + specification/_json_spec/ccr.stats.json | 1 + specification/_json_spec/ccr.unfollow.json | 1 + .../_json_spec/cluster.allocation_explain.json | 1 + .../cluster.delete_component_template.json | 1 + .../cluster.delete_voting_config_exclusions.json | 4 ++-- .../cluster.exists_component_template.json | 1 + .../_json_spec/cluster.get_component_template.json | 1 + specification/_json_spec/cluster.get_settings.json | 1 + specification/_json_spec/cluster.health.json | 1 + specification/_json_spec/cluster.pending_tasks.json | 1 + .../cluster.post_voting_config_exclusions.json | 4 ++-- .../_json_spec/cluster.put_component_template.json | 1 + specification/_json_spec/cluster.put_settings.json | 1 + specification/_json_spec/cluster.reroute.json | 1 + specification/_json_spec/cluster.state.json | 1 + .../dangling_indices.delete_dangling_index.json | 1 + .../dangling_indices.import_dangling_index.json | 1 + specification/_json_spec/delete_script.json | 1 + specification/_json_spec/enrich.delete_policy.json | 1 + specification/_json_spec/enrich.execute_policy.json | 1 + specification/_json_spec/enrich.get_policy.json | 1 + specification/_json_spec/enrich.put_policy.json | 1 + specification/_json_spec/enrich.stats.json | 1 + specification/_json_spec/features.get_features.json | 1 + .../_json_spec/features.reset_features.json | 1 + specification/_json_spec/get_script.json | 1 + specification/_json_spec/ilm.delete_lifecycle.json | 1 + specification/_json_spec/ilm.explain_lifecycle.json | 1 + specification/_json_spec/ilm.get_lifecycle.json | 1 + .../_json_spec/ilm.migrate_to_data_tiers.json | 1 + specification/_json_spec/ilm.put_lifecycle.json | 1 + specification/_json_spec/ilm.start.json | 1 + specification/_json_spec/ilm.stop.json | 1 + specification/_json_spec/indices.add_block.json | 1 + specification/_json_spec/indices.clone.json | 1 + specification/_json_spec/indices.close.json | 1 + specification/_json_spec/indices.create.json | 1 + .../_json_spec/indices.create_data_stream.json | 1 + specification/_json_spec/indices.delete.json | 1 + specification/_json_spec/indices.delete_alias.json | 1 + .../_json_spec/indices.delete_data_lifecycle.json | 1 + .../_json_spec/indices.delete_data_stream.json | 1 + .../indices.delete_data_stream_options.json | 1 + .../_json_spec/indices.delete_index_template.json | 1 + .../_json_spec/indices.delete_template.json | 1 + specification/_json_spec/indices.exists_alias.json | 4 ++-- .../_json_spec/indices.exists_index_template.json | 1 + .../_json_spec/indices.exists_template.json | 1 + .../_json_spec/indices.explain_data_lifecycle.json | 1 + specification/_json_spec/indices.get.json | 1 + specification/_json_spec/indices.get_alias.json | 4 ++-- .../_json_spec/indices.get_data_lifecycle.json | 1 + .../_json_spec/indices.get_data_stream.json | 1 + .../_json_spec/indices.get_data_stream_mappings.json | 1 + .../_json_spec/indices.get_data_stream_options.json | 1 + .../_json_spec/indices.get_data_stream_settings.json | 1 + .../_json_spec/indices.get_index_template.json | 1 + specification/_json_spec/indices.get_mapping.json | 1 + specification/_json_spec/indices.get_settings.json | 1 + specification/_json_spec/indices.get_template.json | 1 + .../_json_spec/indices.migrate_to_data_stream.json | 1 + specification/_json_spec/indices.open.json | 1 + .../_json_spec/indices.promote_data_stream.json | 1 + specification/_json_spec/indices.put_alias.json | 1 + .../_json_spec/indices.put_data_lifecycle.json | 1 + .../_json_spec/indices.put_data_stream_mappings.json | 1 + .../_json_spec/indices.put_data_stream_options.json | 1 + .../_json_spec/indices.put_data_stream_settings.json | 1 + .../_json_spec/indices.put_index_template.json | 1 + specification/_json_spec/indices.put_mapping.json | 1 + specification/_json_spec/indices.put_settings.json | 1 + specification/_json_spec/indices.put_template.json | 1 + specification/_json_spec/indices.remove_block.json | 1 + specification/_json_spec/indices.rollover.json | 1 + specification/_json_spec/indices.shrink.json | 1 + .../_json_spec/indices.simulate_index_template.json | 1 + .../_json_spec/indices.simulate_template.json | 1 + specification/_json_spec/indices.split.json | 1 + specification/_json_spec/indices.update_aliases.json | 1 + specification/_json_spec/inference.delete.json | 6 ++---- .../_json_spec/ingest.delete_geoip_database.json | 1 + .../ingest.delete_ip_location_database.json | 1 + specification/_json_spec/ingest.delete_pipeline.json | 1 + specification/_json_spec/ingest.get_pipeline.json | 1 + .../_json_spec/ingest.put_geoip_database.json | 1 + .../_json_spec/ingest.put_ip_location_database.json | 1 + specification/_json_spec/ingest.put_pipeline.json | 1 + specification/_json_spec/license.delete.json | 1 + specification/_json_spec/license.post.json | 1 + .../_json_spec/license.post_start_basic.json | 1 + .../_json_spec/license.post_start_trial.json | 1 + specification/_json_spec/ml.close_job.json | 2 -- specification/_json_spec/ml.delete_datafeed.json | 1 - specification/_json_spec/ml.delete_expired_data.json | 2 -- specification/_json_spec/ml.delete_forecast.json | 2 -- .../_json_spec/ml.delete_trained_model.json | 2 -- specification/_json_spec/ml.forecast.json | 3 --- .../_json_spec/ml.get_data_frame_analytics.json | 2 -- .../ml.get_data_frame_analytics_stats.json | 2 -- specification/_json_spec/ml.get_datafeed_stats.json | 1 - specification/_json_spec/ml.get_datafeeds.json | 2 -- specification/_json_spec/ml.get_job_stats.json | 1 - specification/_json_spec/ml.get_jobs.json | 2 -- specification/_json_spec/ml.get_memory_stats.json | 1 + .../ml.get_model_snapshot_upgrade_stats.json | 1 - specification/_json_spec/ml.get_trained_models.json | 7 ------- .../_json_spec/ml.get_trained_models_stats.json | 1 - specification/_json_spec/ml.infer_trained_model.json | 1 - specification/_json_spec/ml.preview_datafeed.json | 2 -- specification/_json_spec/ml.put_trained_model.json | 2 -- .../_json_spec/ml.start_data_frame_analytics.json | 1 - specification/_json_spec/ml.start_datafeed.json | 3 --- .../ml.start_trained_model_deployment.json | 12 ++---------- .../_json_spec/ml.stop_data_frame_analytics.json | 3 --- specification/_json_spec/ml.stop_datafeed.json | 3 --- .../_json_spec/ml.stop_trained_model_deployment.json | 2 -- .../ml.update_trained_model_deployment.json | 1 - .../_json_spec/ml.upgrade_job_snapshot.json | 2 -- specification/_json_spec/profiling.status.json | 1 + specification/_json_spec/put_script.json | 1 + specification/_json_spec/rollup.stop_job.json | 2 -- specification/_json_spec/search_shards.json | 1 + .../_json_spec/searchable_snapshots.mount.json | 1 + .../_json_spec/security.clear_cached_realms.json | 3 +-- specification/_json_spec/security.get_settings.json | 1 + .../_json_spec/security.update_settings.json | 1 + specification/_json_spec/shutdown.delete_node.json | 1 + specification/_json_spec/shutdown.get_node.json | 1 + specification/_json_spec/shutdown.put_node.json | 1 + specification/_json_spec/slm.delete_lifecycle.json | 1 + specification/_json_spec/slm.execute_lifecycle.json | 1 + specification/_json_spec/slm.execute_retention.json | 1 + specification/_json_spec/slm.get_lifecycle.json | 1 + specification/_json_spec/slm.get_stats.json | 1 + specification/_json_spec/slm.get_status.json | 1 + specification/_json_spec/slm.put_lifecycle.json | 1 + specification/_json_spec/slm.start.json | 1 + specification/_json_spec/slm.stop.json | 1 + .../_json_spec/snapshot.cleanup_repository.json | 1 + specification/_json_spec/snapshot.clone.json | 1 + specification/_json_spec/snapshot.create.json | 1 + .../_json_spec/snapshot.create_repository.json | 1 + specification/_json_spec/snapshot.delete.json | 1 + .../_json_spec/snapshot.delete_repository.json | 1 + specification/_json_spec/snapshot.get.json | 1 + .../_json_spec/snapshot.get_repository.json | 1 + specification/_json_spec/snapshot.restore.json | 1 + specification/_json_spec/snapshot.status.json | 1 + .../_json_spec/snapshot.verify_repository.json | 1 + specification/_json_spec/streams.logs_disable.json | 1 + specification/_json_spec/streams.logs_enable.json | 1 + .../_json_spec/transform.delete_transform.json | 3 --- .../_json_spec/transform.get_transform.json | 4 ---- .../_json_spec/transform.get_transform_stats.json | 4 ---- .../_json_spec/transform.preview_transform.json | 1 - .../_json_spec/transform.put_transform.json | 2 -- .../_json_spec/transform.reset_transform.json | 2 -- .../_json_spec/transform.schedule_now_transform.json | 1 - .../_json_spec/transform.start_transform.json | 2 -- .../_json_spec/transform.stop_transform.json | 5 ----- .../_json_spec/transform.update_transform.json | 2 -- .../_json_spec/transform.upgrade_transforms.json | 2 -- specification/_json_spec/watcher.execute_watch.json | 3 +-- specification/_json_spec/watcher.get_settings.json | 1 + specification/_json_spec/watcher.start.json | 1 + specification/_json_spec/watcher.stats.json | 3 +-- specification/_json_spec/watcher.stop.json | 1 + .../_json_spec/watcher.update_settings.json | 1 + specification/_json_spec/xpack.info.json | 1 - specification/_json_spec/xpack.usage.json | 1 + 207 files changed, 171 insertions(+), 119 deletions(-) diff --git a/specification/_json_spec/_internal.delete_desired_balance.json b/specification/_json_spec/_internal.delete_desired_balance.json index 4b5034a3ae..5a917cce51 100644 --- a/specification/_json_spec/_internal.delete_desired_balance.json +++ b/specification/_json_spec/_internal.delete_desired_balance.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for connection to master node" } } diff --git a/specification/_json_spec/_internal.delete_desired_nodes.json b/specification/_json_spec/_internal.delete_desired_nodes.json index 32d4707fe0..f1d561d132 100644 --- a/specification/_json_spec/_internal.delete_desired_nodes.json +++ b/specification/_json_spec/_internal.delete_desired_nodes.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/_internal.get_desired_balance.json b/specification/_json_spec/_internal.get_desired_balance.json index f73a5cad89..70c4ce6a59 100644 --- a/specification/_json_spec/_internal.get_desired_balance.json +++ b/specification/_json_spec/_internal.get_desired_balance.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for connection to master node" } } diff --git a/specification/_json_spec/_internal.prevalidate_node_removal.json b/specification/_json_spec/_internal.prevalidate_node_removal.json index 4cd5741bd9..9320c6508e 100644 --- a/specification/_json_spec/_internal.prevalidate_node_removal.json +++ b/specification/_json_spec/_internal.prevalidate_node_removal.json @@ -32,6 +32,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/autoscaling.delete_autoscaling_policy.json b/specification/_json_spec/autoscaling.delete_autoscaling_policy.json index ab137105a1..d2ae7a2f6c 100644 --- a/specification/_json_spec/autoscaling.delete_autoscaling_policy.json +++ b/specification/_json_spec/autoscaling.delete_autoscaling_policy.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" }, "timeout": { diff --git a/specification/_json_spec/autoscaling.get_autoscaling_capacity.json b/specification/_json_spec/autoscaling.get_autoscaling_capacity.json index e90a60277c..0d6844476b 100644 --- a/specification/_json_spec/autoscaling.get_autoscaling_capacity.json +++ b/specification/_json_spec/autoscaling.get_autoscaling_capacity.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" } } diff --git a/specification/_json_spec/autoscaling.get_autoscaling_policy.json b/specification/_json_spec/autoscaling.get_autoscaling_policy.json index 9e23ed7a19..b3380cc855 100644 --- a/specification/_json_spec/autoscaling.get_autoscaling_policy.json +++ b/specification/_json_spec/autoscaling.get_autoscaling_policy.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" } } diff --git a/specification/_json_spec/autoscaling.put_autoscaling_policy.json b/specification/_json_spec/autoscaling.put_autoscaling_policy.json index f121a0bd68..ddf8844284 100644 --- a/specification/_json_spec/autoscaling.put_autoscaling_policy.json +++ b/specification/_json_spec/autoscaling.put_autoscaling_policy.json @@ -27,6 +27,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" }, "timeout": { diff --git a/specification/_json_spec/cat.aliases.json b/specification/_json_spec/cat.aliases.json index f44d577e3b..e69f2abc0e 100644 --- a/specification/_json_spec/cat.aliases.json +++ b/specification/_json_spec/cat.aliases.json @@ -59,8 +59,8 @@ }, "master_timeout": { "type": "time", - "description": "Timeout for waiting for new cluster state in case it is blocked", - "default": "30s" + "default": "30s", + "description": "Timeout for waiting for new cluster state in case it is blocked" } } } diff --git a/specification/_json_spec/cat.allocation.json b/specification/_json_spec/cat.allocation.json index bb8420de8a..b8a5f1da01 100644 --- a/specification/_json_spec/cat.allocation.json +++ b/specification/_json_spec/cat.allocation.json @@ -44,6 +44,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.component_templates.json b/specification/_json_spec/cat.component_templates.json index 1a53c26bab..d55bce0775 100644 --- a/specification/_json_spec/cat.component_templates.json +++ b/specification/_json_spec/cat.component_templates.json @@ -39,6 +39,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.indices.json b/specification/_json_spec/cat.indices.json index aa849dc1ea..9cb526b086 100644 --- a/specification/_json_spec/cat.indices.json +++ b/specification/_json_spec/cat.indices.json @@ -40,6 +40,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.master.json b/specification/_json_spec/cat.master.json index 33a3f98a46..2fa72a5201 100644 --- a/specification/_json_spec/cat.master.json +++ b/specification/_json_spec/cat.master.json @@ -29,6 +29,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.ml_data_frame_analytics.json b/specification/_json_spec/cat.ml_data_frame_analytics.json index f22e037b72..c184e31fa8 100644 --- a/specification/_json_spec/cat.ml_data_frame_analytics.json +++ b/specification/_json_spec/cat.ml_data_frame_analytics.json @@ -30,7 +30,6 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no configs. (This includes `_all` string or when no configs have been specified)" }, "bytes": { diff --git a/specification/_json_spec/cat.ml_datafeeds.json b/specification/_json_spec/cat.ml_datafeeds.json index 0099e50a72..72e0edd2ff 100644 --- a/specification/_json_spec/cat.ml_datafeeds.json +++ b/specification/_json_spec/cat.ml_datafeeds.json @@ -30,7 +30,6 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" }, "format": { diff --git a/specification/_json_spec/cat.ml_jobs.json b/specification/_json_spec/cat.ml_jobs.json index 4f097c20f8..304979056f 100644 --- a/specification/_json_spec/cat.ml_jobs.json +++ b/specification/_json_spec/cat.ml_jobs.json @@ -30,7 +30,6 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" }, "bytes": { diff --git a/specification/_json_spec/cat.ml_trained_models.json b/specification/_json_spec/cat.ml_trained_models.json index 34b25ba2e9..f6a7396972 100644 --- a/specification/_json_spec/cat.ml_trained_models.json +++ b/specification/_json_spec/cat.ml_trained_models.json @@ -30,7 +30,6 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified)", "default": true }, diff --git a/specification/_json_spec/cat.nodeattrs.json b/specification/_json_spec/cat.nodeattrs.json index 79be8801ef..88760181fa 100644 --- a/specification/_json_spec/cat.nodeattrs.json +++ b/specification/_json_spec/cat.nodeattrs.json @@ -29,6 +29,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.nodes.json b/specification/_json_spec/cat.nodes.json index aa49f8cfa3..b297f8ea8f 100644 --- a/specification/_json_spec/cat.nodes.json +++ b/specification/_json_spec/cat.nodes.json @@ -34,6 +34,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.pending_tasks.json b/specification/_json_spec/cat.pending_tasks.json index 1db0c59593..4b1df07146 100644 --- a/specification/_json_spec/cat.pending_tasks.json +++ b/specification/_json_spec/cat.pending_tasks.json @@ -29,6 +29,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.plugins.json b/specification/_json_spec/cat.plugins.json index 7336f9d10c..b854e3827b 100644 --- a/specification/_json_spec/cat.plugins.json +++ b/specification/_json_spec/cat.plugins.json @@ -29,6 +29,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.repositories.json b/specification/_json_spec/cat.repositories.json index e45483b701..351ad25d5c 100644 --- a/specification/_json_spec/cat.repositories.json +++ b/specification/_json_spec/cat.repositories.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.segments.json b/specification/_json_spec/cat.segments.json index e3d3f09b55..d53ca6e160 100644 --- a/specification/_json_spec/cat.segments.json +++ b/specification/_json_spec/cat.segments.json @@ -39,6 +39,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "bytes": { diff --git a/specification/_json_spec/cat.shards.json b/specification/_json_spec/cat.shards.json index 1d2d8de13c..e753db39f3 100644 --- a/specification/_json_spec/cat.shards.json +++ b/specification/_json_spec/cat.shards.json @@ -40,6 +40,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.snapshots.json b/specification/_json_spec/cat.snapshots.json index 73e5de45b2..1d81a26025 100644 --- a/specification/_json_spec/cat.snapshots.json +++ b/specification/_json_spec/cat.snapshots.json @@ -40,6 +40,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.templates.json b/specification/_json_spec/cat.templates.json index 9592cc6379..a581fe3070 100644 --- a/specification/_json_spec/cat.templates.json +++ b/specification/_json_spec/cat.templates.json @@ -39,6 +39,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.thread_pool.json b/specification/_json_spec/cat.thread_pool.json index 0a0fb2fde0..e5cb025867 100644 --- a/specification/_json_spec/cat.thread_pool.json +++ b/specification/_json_spec/cat.thread_pool.json @@ -44,6 +44,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "h": { diff --git a/specification/_json_spec/cat.transforms.json b/specification/_json_spec/cat.transforms.json index 6ad5442463..ef1f631fae 100644 --- a/specification/_json_spec/cat.transforms.json +++ b/specification/_json_spec/cat.transforms.json @@ -30,17 +30,14 @@ "params": { "from": { "type": "int", - "required": false, "description": "skips a number of transform configs, defaults to 0" }, "size": { "type": "int", - "required": false, "description": "specifies a max number of transforms to get, defaults to 100" }, "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)" }, "format": { diff --git a/specification/_json_spec/ccr.delete_auto_follow_pattern.json b/specification/_json_spec/ccr.delete_auto_follow_pattern.json index 8dda34ec9d..3de651d098 100644 --- a/specification/_json_spec/ccr.delete_auto_follow_pattern.json +++ b/specification/_json_spec/ccr.delete_auto_follow_pattern.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/ccr.follow.json b/specification/_json_spec/ccr.follow.json index c1db76f7e5..6d0bb46e2d 100644 --- a/specification/_json_spec/ccr.follow.json +++ b/specification/_json_spec/ccr.follow.json @@ -32,6 +32,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } }, diff --git a/specification/_json_spec/ccr.follow_info.json b/specification/_json_spec/ccr.follow_info.json index cda715a166..dcff396a56 100644 --- a/specification/_json_spec/ccr.follow_info.json +++ b/specification/_json_spec/ccr.follow_info.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/ccr.get_auto_follow_pattern.json b/specification/_json_spec/ccr.get_auto_follow_pattern.json index ccb09070f6..8fcdec0433 100644 --- a/specification/_json_spec/ccr.get_auto_follow_pattern.json +++ b/specification/_json_spec/ccr.get_auto_follow_pattern.json @@ -30,6 +30,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/ccr.pause_auto_follow_pattern.json b/specification/_json_spec/ccr.pause_auto_follow_pattern.json index 1deffa7cf6..91f14ead8f 100644 --- a/specification/_json_spec/ccr.pause_auto_follow_pattern.json +++ b/specification/_json_spec/ccr.pause_auto_follow_pattern.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/ccr.pause_follow.json b/specification/_json_spec/ccr.pause_follow.json index 3f83512ae2..083a95dcfb 100644 --- a/specification/_json_spec/ccr.pause_follow.json +++ b/specification/_json_spec/ccr.pause_follow.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/ccr.put_auto_follow_pattern.json b/specification/_json_spec/ccr.put_auto_follow_pattern.json index 2f8654b2f2..e5b74db6ca 100644 --- a/specification/_json_spec/ccr.put_auto_follow_pattern.json +++ b/specification/_json_spec/ccr.put_auto_follow_pattern.json @@ -27,6 +27,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } }, diff --git a/specification/_json_spec/ccr.resume_auto_follow_pattern.json b/specification/_json_spec/ccr.resume_auto_follow_pattern.json index 1dfca73d27..1ad685ae45 100644 --- a/specification/_json_spec/ccr.resume_auto_follow_pattern.json +++ b/specification/_json_spec/ccr.resume_auto_follow_pattern.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/ccr.resume_follow.json b/specification/_json_spec/ccr.resume_follow.json index 896f914ad9..5562d25e70 100644 --- a/specification/_json_spec/ccr.resume_follow.json +++ b/specification/_json_spec/ccr.resume_follow.json @@ -27,6 +27,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } }, diff --git a/specification/_json_spec/ccr.stats.json b/specification/_json_spec/ccr.stats.json index 3b6f8b4112..51b3ed0ae1 100644 --- a/specification/_json_spec/ccr.stats.json +++ b/specification/_json_spec/ccr.stats.json @@ -24,6 +24,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/ccr.unfollow.json b/specification/_json_spec/ccr.unfollow.json index 54667dc3c1..11d2907e55 100644 --- a/specification/_json_spec/ccr.unfollow.json +++ b/specification/_json_spec/ccr.unfollow.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/cluster.allocation_explain.json b/specification/_json_spec/cluster.allocation_explain.json index 670f13fb74..1710ecf758 100644 --- a/specification/_json_spec/cluster.allocation_explain.json +++ b/specification/_json_spec/cluster.allocation_explain.json @@ -37,6 +37,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for connection to master node" }, "include_yes_decisions": { diff --git a/specification/_json_spec/cluster.delete_component_template.json b/specification/_json_spec/cluster.delete_component_template.json index 375a834cb6..caefdf48d7 100644 --- a/specification/_json_spec/cluster.delete_component_template.json +++ b/specification/_json_spec/cluster.delete_component_template.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/cluster.delete_voting_config_exclusions.json b/specification/_json_spec/cluster.delete_voting_config_exclusions.json index ef52e7dbab..582f16658a 100644 --- a/specification/_json_spec/cluster.delete_voting_config_exclusions.json +++ b/specification/_json_spec/cluster.delete_voting_config_exclusions.json @@ -25,8 +25,8 @@ }, "master_timeout": { "type": "time", - "description": "Timeout for submitting request to master", - "default": "30s" + "default": "30s", + "description": "Timeout for submitting request to master" } } } diff --git a/specification/_json_spec/cluster.exists_component_template.json b/specification/_json_spec/cluster.exists_component_template.json index 3c7c82a2e5..c99d5fb16d 100644 --- a/specification/_json_spec/cluster.exists_component_template.json +++ b/specification/_json_spec/cluster.exists_component_template.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for waiting for new cluster state in case it is blocked" }, "local": { diff --git a/specification/_json_spec/cluster.get_component_template.json b/specification/_json_spec/cluster.get_component_template.json index 645f064e8f..542a9ee0b5 100644 --- a/specification/_json_spec/cluster.get_component_template.json +++ b/specification/_json_spec/cluster.get_component_template.json @@ -30,6 +30,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for waiting for new cluster state in case it is blocked" }, "local": { diff --git a/specification/_json_spec/cluster.get_settings.json b/specification/_json_spec/cluster.get_settings.json index 8a19d75e60..2122e854f5 100644 --- a/specification/_json_spec/cluster.get_settings.json +++ b/specification/_json_spec/cluster.get_settings.json @@ -24,6 +24,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for waiting for new cluster state in case it is blocked" }, "timeout": { diff --git a/specification/_json_spec/cluster.health.json b/specification/_json_spec/cluster.health.json index 9d9a40a4c0..5872557875 100644 --- a/specification/_json_spec/cluster.health.json +++ b/specification/_json_spec/cluster.health.json @@ -46,6 +46,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/cluster.pending_tasks.json b/specification/_json_spec/cluster.pending_tasks.json index 5777b9ba8c..d2bf061221 100644 --- a/specification/_json_spec/cluster.pending_tasks.json +++ b/specification/_json_spec/cluster.pending_tasks.json @@ -24,6 +24,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/cluster.post_voting_config_exclusions.json b/specification/_json_spec/cluster.post_voting_config_exclusions.json index aa99da4b42..971a326cfd 100644 --- a/specification/_json_spec/cluster.post_voting_config_exclusions.json +++ b/specification/_json_spec/cluster.post_voting_config_exclusions.json @@ -33,8 +33,8 @@ }, "master_timeout": { "type": "time", - "description": "Timeout for submitting request to master", - "default": "30s" + "default": "30s", + "description": "Timeout for submitting request to master" } } } diff --git a/specification/_json_spec/cluster.put_component_template.json b/specification/_json_spec/cluster.put_component_template.json index cbacc81c0b..18b6b39d26 100644 --- a/specification/_json_spec/cluster.put_component_template.json +++ b/specification/_json_spec/cluster.put_component_template.json @@ -37,6 +37,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } }, diff --git a/specification/_json_spec/cluster.put_settings.json b/specification/_json_spec/cluster.put_settings.json index 6d4203f61b..e17da45c9c 100644 --- a/specification/_json_spec/cluster.put_settings.json +++ b/specification/_json_spec/cluster.put_settings.json @@ -25,6 +25,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/cluster.reroute.json b/specification/_json_spec/cluster.reroute.json index e62c472a97..d704870ef3 100644 --- a/specification/_json_spec/cluster.reroute.json +++ b/specification/_json_spec/cluster.reroute.json @@ -47,6 +47,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/cluster.state.json b/specification/_json_spec/cluster.state.json index 14f76db57e..e36034be2a 100644 --- a/specification/_json_spec/cluster.state.json +++ b/specification/_json_spec/cluster.state.json @@ -69,6 +69,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for waiting for new cluster state in case it is blocked" }, "flat_settings": { diff --git a/specification/_json_spec/dangling_indices.delete_dangling_index.json b/specification/_json_spec/dangling_indices.delete_dangling_index.json index 542cd83662..7613cd4906 100644 --- a/specification/_json_spec/dangling_indices.delete_dangling_index.json +++ b/specification/_json_spec/dangling_indices.delete_dangling_index.json @@ -34,6 +34,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/dangling_indices.import_dangling_index.json b/specification/_json_spec/dangling_indices.import_dangling_index.json index d1a49946e3..dbc5e0e4df 100644 --- a/specification/_json_spec/dangling_indices.import_dangling_index.json +++ b/specification/_json_spec/dangling_indices.import_dangling_index.json @@ -34,6 +34,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/delete_script.json b/specification/_json_spec/delete_script.json index 59c8b4fd70..74c7da8c78 100644 --- a/specification/_json_spec/delete_script.json +++ b/specification/_json_spec/delete_script.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/enrich.delete_policy.json b/specification/_json_spec/enrich.delete_policy.json index a331209dd8..f83178ac7a 100644 --- a/specification/_json_spec/enrich.delete_policy.json +++ b/specification/_json_spec/enrich.delete_policy.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" } } diff --git a/specification/_json_spec/enrich.execute_policy.json b/specification/_json_spec/enrich.execute_policy.json index 65e9031dc6..3c8689d819 100644 --- a/specification/_json_spec/enrich.execute_policy.json +++ b/specification/_json_spec/enrich.execute_policy.json @@ -31,6 +31,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" } } diff --git a/specification/_json_spec/enrich.get_policy.json b/specification/_json_spec/enrich.get_policy.json index 4e5997c3be..eb32a1b774 100644 --- a/specification/_json_spec/enrich.get_policy.json +++ b/specification/_json_spec/enrich.get_policy.json @@ -30,6 +30,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for waiting for new cluster state in case it is blocked" } } diff --git a/specification/_json_spec/enrich.put_policy.json b/specification/_json_spec/enrich.put_policy.json index cef8dfc1df..b87c6968e5 100644 --- a/specification/_json_spec/enrich.put_policy.json +++ b/specification/_json_spec/enrich.put_policy.json @@ -31,6 +31,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" } } diff --git a/specification/_json_spec/enrich.stats.json b/specification/_json_spec/enrich.stats.json index 6424e6e5ab..d3dc7c68cc 100644 --- a/specification/_json_spec/enrich.stats.json +++ b/specification/_json_spec/enrich.stats.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for waiting for new cluster state in case it is blocked" } } diff --git a/specification/_json_spec/features.get_features.json b/specification/_json_spec/features.get_features.json index 85eaf8a479..7cf84a910d 100644 --- a/specification/_json_spec/features.get_features.json +++ b/specification/_json_spec/features.get_features.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/features.reset_features.json b/specification/_json_spec/features.reset_features.json index 5d4b519bcb..d48ce9da7c 100644 --- a/specification/_json_spec/features.reset_features.json +++ b/specification/_json_spec/features.reset_features.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/get_script.json b/specification/_json_spec/get_script.json index c61327e37d..5eeb5eb50c 100644 --- a/specification/_json_spec/get_script.json +++ b/specification/_json_spec/get_script.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/ilm.delete_lifecycle.json b/specification/_json_spec/ilm.delete_lifecycle.json index 48b8a4e81c..d8844a71fa 100644 --- a/specification/_json_spec/ilm.delete_lifecycle.json +++ b/specification/_json_spec/ilm.delete_lifecycle.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/ilm.explain_lifecycle.json b/specification/_json_spec/ilm.explain_lifecycle.json index 0dcebd2a4e..51b434ff98 100644 --- a/specification/_json_spec/ilm.explain_lifecycle.json +++ b/specification/_json_spec/ilm.explain_lifecycle.json @@ -34,6 +34,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/ilm.get_lifecycle.json b/specification/_json_spec/ilm.get_lifecycle.json index ff5ca14803..7187eeaba3 100644 --- a/specification/_json_spec/ilm.get_lifecycle.json +++ b/specification/_json_spec/ilm.get_lifecycle.json @@ -30,6 +30,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/ilm.migrate_to_data_tiers.json b/specification/_json_spec/ilm.migrate_to_data_tiers.json index 4613002ebc..c6805f21de 100644 --- a/specification/_json_spec/ilm.migrate_to_data_tiers.json +++ b/specification/_json_spec/ilm.migrate_to_data_tiers.json @@ -21,6 +21,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "dry_run": { diff --git a/specification/_json_spec/ilm.put_lifecycle.json b/specification/_json_spec/ilm.put_lifecycle.json index 4bdd1942c7..5a47f10821 100644 --- a/specification/_json_spec/ilm.put_lifecycle.json +++ b/specification/_json_spec/ilm.put_lifecycle.json @@ -27,6 +27,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/ilm.start.json b/specification/_json_spec/ilm.start.json index bf1fceb2cb..43d7ec7590 100644 --- a/specification/_json_spec/ilm.start.json +++ b/specification/_json_spec/ilm.start.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/ilm.stop.json b/specification/_json_spec/ilm.stop.json index ffb3427484..0bf41556f8 100644 --- a/specification/_json_spec/ilm.stop.json +++ b/specification/_json_spec/ilm.stop.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/indices.add_block.json b/specification/_json_spec/indices.add_block.json index dfbb82f848..3796e83ee9 100644 --- a/specification/_json_spec/indices.add_block.json +++ b/specification/_json_spec/indices.add_block.json @@ -34,6 +34,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "ignore_unavailable": { diff --git a/specification/_json_spec/indices.clone.json b/specification/_json_spec/indices.clone.json index 196995c491..52138eb9db 100644 --- a/specification/_json_spec/indices.clone.json +++ b/specification/_json_spec/indices.clone.json @@ -35,6 +35,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "wait_for_active_shards": { diff --git a/specification/_json_spec/indices.close.json b/specification/_json_spec/indices.close.json index ed1ccbd6a2..290ca9a242 100644 --- a/specification/_json_spec/indices.close.json +++ b/specification/_json_spec/indices.close.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "ignore_unavailable": { diff --git a/specification/_json_spec/indices.create.json b/specification/_json_spec/indices.create.json index 4aa518fce6..6bc348b945 100644 --- a/specification/_json_spec/indices.create.json +++ b/specification/_json_spec/indices.create.json @@ -35,6 +35,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } }, diff --git a/specification/_json_spec/indices.create_data_stream.json b/specification/_json_spec/indices.create_data_stream.json index 603268931a..0a1e72bbd2 100644 --- a/specification/_json_spec/indices.create_data_stream.json +++ b/specification/_json_spec/indices.create_data_stream.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.delete.json b/specification/_json_spec/indices.delete.json index e0746dbf8e..2197c8a6ec 100644 --- a/specification/_json_spec/indices.delete.json +++ b/specification/_json_spec/indices.delete.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "ignore_unavailable": { diff --git a/specification/_json_spec/indices.delete_alias.json b/specification/_json_spec/indices.delete_alias.json index 279c8133dc..3469778438 100644 --- a/specification/_json_spec/indices.delete_alias.json +++ b/specification/_json_spec/indices.delete_alias.json @@ -48,6 +48,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.delete_data_lifecycle.json b/specification/_json_spec/indices.delete_data_lifecycle.json index 91a3ba13e0..3cc331f44a 100644 --- a/specification/_json_spec/indices.delete_data_lifecycle.json +++ b/specification/_json_spec/indices.delete_data_lifecycle.json @@ -36,6 +36,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.delete_data_stream.json b/specification/_json_spec/indices.delete_data_stream.json index fcec9e52c5..84e95876ec 100644 --- a/specification/_json_spec/indices.delete_data_stream.json +++ b/specification/_json_spec/indices.delete_data_stream.json @@ -32,6 +32,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.delete_data_stream_options.json b/specification/_json_spec/indices.delete_data_stream_options.json index 11615587b8..3ec19540d1 100644 --- a/specification/_json_spec/indices.delete_data_stream_options.json +++ b/specification/_json_spec/indices.delete_data_stream_options.json @@ -36,6 +36,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.delete_index_template.json b/specification/_json_spec/indices.delete_index_template.json index 350d6677ff..34534747fb 100644 --- a/specification/_json_spec/indices.delete_index_template.json +++ b/specification/_json_spec/indices.delete_index_template.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.delete_template.json b/specification/_json_spec/indices.delete_template.json index aba74d6be4..095983e895 100644 --- a/specification/_json_spec/indices.delete_template.json +++ b/specification/_json_spec/indices.delete_template.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.exists_alias.json b/specification/_json_spec/indices.exists_alias.json index 10ff1ee6ed..e92c8f4b6c 100644 --- a/specification/_json_spec/indices.exists_alias.json +++ b/specification/_json_spec/indices.exists_alias.json @@ -54,8 +54,8 @@ }, "master_timeout": { "type": "time", - "description": "Timeout for waiting for new cluster state in case it is blocked", - "default": "30s" + "default": "30s", + "description": "Timeout for waiting for new cluster state in case it is blocked" } } } diff --git a/specification/_json_spec/indices.exists_index_template.json b/specification/_json_spec/indices.exists_index_template.json index cb1088eacb..22f8d89357 100644 --- a/specification/_json_spec/indices.exists_index_template.json +++ b/specification/_json_spec/indices.exists_index_template.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "local": { diff --git a/specification/_json_spec/indices.exists_template.json b/specification/_json_spec/indices.exists_template.json index a03b1c58fe..827582b023 100644 --- a/specification/_json_spec/indices.exists_template.json +++ b/specification/_json_spec/indices.exists_template.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for waiting for new cluster state in case it is blocked" }, "local": { diff --git a/specification/_json_spec/indices.explain_data_lifecycle.json b/specification/_json_spec/indices.explain_data_lifecycle.json index 467b42e9cf..cf0aa2a2a5 100644 --- a/specification/_json_spec/indices.explain_data_lifecycle.json +++ b/specification/_json_spec/indices.explain_data_lifecycle.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.get.json b/specification/_json_spec/indices.get.json index f7c982f536..62e663557a 100644 --- a/specification/_json_spec/indices.get.json +++ b/specification/_json_spec/indices.get.json @@ -59,6 +59,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.get_alias.json b/specification/_json_spec/indices.get_alias.json index 6a2982099f..c263cc3f72 100644 --- a/specification/_json_spec/indices.get_alias.json +++ b/specification/_json_spec/indices.get_alias.json @@ -68,8 +68,8 @@ }, "master_timeout": { "type": "time", - "description": "Timeout for waiting for new cluster state in case it is blocked", - "default": "30s" + "default": "30s", + "description": "Timeout for waiting for new cluster state in case it is blocked" } } } diff --git a/specification/_json_spec/indices.get_data_lifecycle.json b/specification/_json_spec/indices.get_data_lifecycle.json index 38c1ecb0df..a067bef879 100644 --- a/specification/_json_spec/indices.get_data_lifecycle.json +++ b/specification/_json_spec/indices.get_data_lifecycle.json @@ -36,6 +36,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.get_data_stream.json b/specification/_json_spec/indices.get_data_stream.json index d119620147..6a690bb417 100644 --- a/specification/_json_spec/indices.get_data_stream.json +++ b/specification/_json_spec/indices.get_data_stream.json @@ -40,6 +40,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "verbose": { diff --git a/specification/_json_spec/indices.get_data_stream_mappings.json b/specification/_json_spec/indices.get_data_stream_mappings.json index 3e5404dcb6..a2ab036013 100644 --- a/specification/_json_spec/indices.get_data_stream_mappings.json +++ b/specification/_json_spec/indices.get_data_stream_mappings.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Period to wait for a connection to the master node" } } diff --git a/specification/_json_spec/indices.get_data_stream_options.json b/specification/_json_spec/indices.get_data_stream_options.json index 0a259cdde7..a94c7e6e3d 100644 --- a/specification/_json_spec/indices.get_data_stream_options.json +++ b/specification/_json_spec/indices.get_data_stream_options.json @@ -32,6 +32,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.get_data_stream_settings.json b/specification/_json_spec/indices.get_data_stream_settings.json index fe0a5deb83..7a1c25fe7e 100644 --- a/specification/_json_spec/indices.get_data_stream_settings.json +++ b/specification/_json_spec/indices.get_data_stream_settings.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Period to wait for a connection to the master node" } } diff --git a/specification/_json_spec/indices.get_index_template.json b/specification/_json_spec/indices.get_index_template.json index cd6f748b37..802a48e82e 100644 --- a/specification/_json_spec/indices.get_index_template.json +++ b/specification/_json_spec/indices.get_index_template.json @@ -34,6 +34,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for waiting for new cluster state in case it is blocked" }, "local": { diff --git a/specification/_json_spec/indices.get_mapping.json b/specification/_json_spec/indices.get_mapping.json index da48a33b5a..9d9feb19f9 100644 --- a/specification/_json_spec/indices.get_mapping.json +++ b/specification/_json_spec/indices.get_mapping.json @@ -44,6 +44,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for waiting for new cluster state in case it is blocked" }, "local": { diff --git a/specification/_json_spec/indices.get_settings.json b/specification/_json_spec/indices.get_settings.json index 7abd292450..419b8af685 100644 --- a/specification/_json_spec/indices.get_settings.json +++ b/specification/_json_spec/indices.get_settings.json @@ -54,6 +54,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "ignore_unavailable": { diff --git a/specification/_json_spec/indices.get_template.json b/specification/_json_spec/indices.get_template.json index ffde2b851a..796fc63d0b 100644 --- a/specification/_json_spec/indices.get_template.json +++ b/specification/_json_spec/indices.get_template.json @@ -34,6 +34,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for waiting for new cluster state in case it is blocked" }, "local": { diff --git a/specification/_json_spec/indices.migrate_to_data_stream.json b/specification/_json_spec/indices.migrate_to_data_stream.json index 2bab238947..7bf74c9815 100644 --- a/specification/_json_spec/indices.migrate_to_data_stream.json +++ b/specification/_json_spec/indices.migrate_to_data_stream.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.open.json b/specification/_json_spec/indices.open.json index 5d4a11d0b6..b5be892e19 100644 --- a/specification/_json_spec/indices.open.json +++ b/specification/_json_spec/indices.open.json @@ -30,6 +30,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "ignore_unavailable": { diff --git a/specification/_json_spec/indices.promote_data_stream.json b/specification/_json_spec/indices.promote_data_stream.json index af5e889ee7..48b4a1d397 100644 --- a/specification/_json_spec/indices.promote_data_stream.json +++ b/specification/_json_spec/indices.promote_data_stream.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/indices.put_alias.json b/specification/_json_spec/indices.put_alias.json index 4b730b7944..67073c33ef 100644 --- a/specification/_json_spec/indices.put_alias.json +++ b/specification/_json_spec/indices.put_alias.json @@ -49,6 +49,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } }, diff --git a/specification/_json_spec/indices.put_data_lifecycle.json b/specification/_json_spec/indices.put_data_lifecycle.json index 16b0aa703c..7d7255adb2 100644 --- a/specification/_json_spec/indices.put_data_lifecycle.json +++ b/specification/_json_spec/indices.put_data_lifecycle.json @@ -37,6 +37,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } }, diff --git a/specification/_json_spec/indices.put_data_stream_mappings.json b/specification/_json_spec/indices.put_data_stream_mappings.json index b671640883..264736e467 100644 --- a/specification/_json_spec/indices.put_data_stream_mappings.json +++ b/specification/_json_spec/indices.put_data_stream_mappings.json @@ -35,6 +35,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Period to wait for a connection to the master node" } }, diff --git a/specification/_json_spec/indices.put_data_stream_options.json b/specification/_json_spec/indices.put_data_stream_options.json index c281ff870c..c4e93db91d 100644 --- a/specification/_json_spec/indices.put_data_stream_options.json +++ b/specification/_json_spec/indices.put_data_stream_options.json @@ -37,6 +37,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } }, diff --git a/specification/_json_spec/indices.put_data_stream_settings.json b/specification/_json_spec/indices.put_data_stream_settings.json index 5ca923ee83..aa89992191 100644 --- a/specification/_json_spec/indices.put_data_stream_settings.json +++ b/specification/_json_spec/indices.put_data_stream_settings.json @@ -35,6 +35,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Period to wait for a connection to the master node" } }, diff --git a/specification/_json_spec/indices.put_index_template.json b/specification/_json_spec/indices.put_index_template.json index 96f7e48caa..25fbf145cf 100644 --- a/specification/_json_spec/indices.put_index_template.json +++ b/specification/_json_spec/indices.put_index_template.json @@ -37,6 +37,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } }, diff --git a/specification/_json_spec/indices.put_mapping.json b/specification/_json_spec/indices.put_mapping.json index 4059c16c26..e11749392b 100644 --- a/specification/_json_spec/indices.put_mapping.json +++ b/specification/_json_spec/indices.put_mapping.json @@ -31,6 +31,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "ignore_unavailable": { diff --git a/specification/_json_spec/indices.put_settings.json b/specification/_json_spec/indices.put_settings.json index 68144b8c4d..88d0847baa 100644 --- a/specification/_json_spec/indices.put_settings.json +++ b/specification/_json_spec/indices.put_settings.json @@ -31,6 +31,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "timeout": { diff --git a/specification/_json_spec/indices.put_template.json b/specification/_json_spec/indices.put_template.json index 0c31e8e8c1..8caf083184 100644 --- a/specification/_json_spec/indices.put_template.json +++ b/specification/_json_spec/indices.put_template.json @@ -41,6 +41,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } }, diff --git a/specification/_json_spec/indices.remove_block.json b/specification/_json_spec/indices.remove_block.json index a3b69b7745..20f12e7f0e 100644 --- a/specification/_json_spec/indices.remove_block.json +++ b/specification/_json_spec/indices.remove_block.json @@ -34,6 +34,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "ignore_unavailable": { diff --git a/specification/_json_spec/indices.rollover.json b/specification/_json_spec/indices.rollover.json index 03966b9377..e81972e445 100644 --- a/specification/_json_spec/indices.rollover.json +++ b/specification/_json_spec/indices.rollover.json @@ -49,6 +49,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "wait_for_active_shards": { diff --git a/specification/_json_spec/indices.shrink.json b/specification/_json_spec/indices.shrink.json index f846aacd49..0f14e0d1b2 100644 --- a/specification/_json_spec/indices.shrink.json +++ b/specification/_json_spec/indices.shrink.json @@ -35,6 +35,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "wait_for_active_shards": { diff --git a/specification/_json_spec/indices.simulate_index_template.json b/specification/_json_spec/indices.simulate_index_template.json index 39ccd9d54b..62731ee33e 100644 --- a/specification/_json_spec/indices.simulate_index_template.json +++ b/specification/_json_spec/indices.simulate_index_template.json @@ -37,6 +37,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "include_defaults": { diff --git a/specification/_json_spec/indices.simulate_template.json b/specification/_json_spec/indices.simulate_template.json index fde68f9f38..a5f043cbb0 100644 --- a/specification/_json_spec/indices.simulate_template.json +++ b/specification/_json_spec/indices.simulate_template.json @@ -41,6 +41,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "include_defaults": { diff --git a/specification/_json_spec/indices.split.json b/specification/_json_spec/indices.split.json index 5a62d98983..3af07f1410 100644 --- a/specification/_json_spec/indices.split.json +++ b/specification/_json_spec/indices.split.json @@ -35,6 +35,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "wait_for_active_shards": { diff --git a/specification/_json_spec/indices.update_aliases.json b/specification/_json_spec/indices.update_aliases.json index 36612249ed..4c65242537 100644 --- a/specification/_json_spec/indices.update_aliases.json +++ b/specification/_json_spec/indices.update_aliases.json @@ -25,6 +25,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } }, diff --git a/specification/_json_spec/inference.delete.json b/specification/_json_spec/inference.delete.json index bb0dd202cf..057aed6cd6 100644 --- a/specification/_json_spec/inference.delete.json +++ b/specification/_json_spec/inference.delete.json @@ -40,13 +40,11 @@ "params": { "dry_run": { "type": "boolean", - "description": "If true the endpoint will not be deleted and a list of ingest processors which reference this endpoint will be returned.", - "required": false + "description": "If true the endpoint will not be deleted and a list of ingest processors which reference this endpoint will be returned." }, "force": { "type": "boolean", - "description": "If true the endpoint will be forcefully stopped (regardless of whether or not it is referenced by any ingest processors or semantic text fields).", - "required": false + "description": "If true the endpoint will be forcefully stopped (regardless of whether or not it is referenced by any ingest processors or semantic text fields)." } } } diff --git a/specification/_json_spec/ingest.delete_geoip_database.json b/specification/_json_spec/ingest.delete_geoip_database.json index 938b0bab13..87dc0d0003 100644 --- a/specification/_json_spec/ingest.delete_geoip_database.json +++ b/specification/_json_spec/ingest.delete_geoip_database.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/ingest.delete_ip_location_database.json b/specification/_json_spec/ingest.delete_ip_location_database.json index be1ae314b2..11bf93abe3 100644 --- a/specification/_json_spec/ingest.delete_ip_location_database.json +++ b/specification/_json_spec/ingest.delete_ip_location_database.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/ingest.delete_pipeline.json b/specification/_json_spec/ingest.delete_pipeline.json index ddd70143d1..f057bbe673 100644 --- a/specification/_json_spec/ingest.delete_pipeline.json +++ b/specification/_json_spec/ingest.delete_pipeline.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/ingest.get_pipeline.json b/specification/_json_spec/ingest.get_pipeline.json index e454bd7ee4..c767ea891a 100644 --- a/specification/_json_spec/ingest.get_pipeline.json +++ b/specification/_json_spec/ingest.get_pipeline.json @@ -34,6 +34,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/ingest.put_geoip_database.json b/specification/_json_spec/ingest.put_geoip_database.json index 3889946bee..c11993f5fd 100644 --- a/specification/_json_spec/ingest.put_geoip_database.json +++ b/specification/_json_spec/ingest.put_geoip_database.json @@ -27,6 +27,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/ingest.put_ip_location_database.json b/specification/_json_spec/ingest.put_ip_location_database.json index 634cf4c3a8..185af68287 100644 --- a/specification/_json_spec/ingest.put_ip_location_database.json +++ b/specification/_json_spec/ingest.put_ip_location_database.json @@ -27,6 +27,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/ingest.put_pipeline.json b/specification/_json_spec/ingest.put_pipeline.json index 0693256469..8135a60fe2 100644 --- a/specification/_json_spec/ingest.put_pipeline.json +++ b/specification/_json_spec/ingest.put_pipeline.json @@ -31,6 +31,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/license.delete.json b/specification/_json_spec/license.delete.json index b908e987ce..430837870c 100644 --- a/specification/_json_spec/license.delete.json +++ b/specification/_json_spec/license.delete.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" }, "timeout": { diff --git a/specification/_json_spec/license.post.json b/specification/_json_spec/license.post.json index 66e39bfaf1..419f012163 100644 --- a/specification/_json_spec/license.post.json +++ b/specification/_json_spec/license.post.json @@ -25,6 +25,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" }, "timeout": { diff --git a/specification/_json_spec/license.post_start_basic.json b/specification/_json_spec/license.post_start_basic.json index b4baa5e5ff..39a22f5e6b 100644 --- a/specification/_json_spec/license.post_start_basic.json +++ b/specification/_json_spec/license.post_start_basic.json @@ -24,6 +24,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" }, "timeout": { diff --git a/specification/_json_spec/license.post_start_trial.json b/specification/_json_spec/license.post_start_trial.json index fe3580ad1a..91bb6e1b80 100644 --- a/specification/_json_spec/license.post_start_trial.json +++ b/specification/_json_spec/license.post_start_trial.json @@ -28,6 +28,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" } } diff --git a/specification/_json_spec/ml.close_job.json b/specification/_json_spec/ml.close_job.json index 58afb5e33e..9bb6332b7c 100644 --- a/specification/_json_spec/ml.close_job.json +++ b/specification/_json_spec/ml.close_job.json @@ -27,12 +27,10 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" }, "force": { "type": "boolean", - "required": false, "description": "True if the job should be forcefully closed" }, "timeout": { diff --git a/specification/_json_spec/ml.delete_datafeed.json b/specification/_json_spec/ml.delete_datafeed.json index 8cb78ae238..1cac823610 100644 --- a/specification/_json_spec/ml.delete_datafeed.json +++ b/specification/_json_spec/ml.delete_datafeed.json @@ -26,7 +26,6 @@ "params": { "force": { "type": "boolean", - "required": false, "description": "True if the datafeed should be forcefully deleted" } } diff --git a/specification/_json_spec/ml.delete_expired_data.json b/specification/_json_spec/ml.delete_expired_data.json index 54af79e189..adafb23f16 100644 --- a/specification/_json_spec/ml.delete_expired_data.json +++ b/specification/_json_spec/ml.delete_expired_data.json @@ -31,12 +31,10 @@ "params": { "requests_per_second": { "type": "number", - "required": false, "description": "The desired requests per second for the deletion processes." }, "timeout": { "type": "time", - "required": false, "description": "How long can the underlying delete processes run until they are canceled" } }, diff --git a/specification/_json_spec/ml.delete_forecast.json b/specification/_json_spec/ml.delete_forecast.json index 36cd515514..820b370c27 100644 --- a/specification/_json_spec/ml.delete_forecast.json +++ b/specification/_json_spec/ml.delete_forecast.json @@ -40,12 +40,10 @@ "params": { "allow_no_forecasts": { "type": "boolean", - "required": false, "description": "Whether to ignore if `_all` matches no forecasts" }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait until the forecast(s) are deleted. Default to 30 seconds" } } diff --git a/specification/_json_spec/ml.delete_trained_model.json b/specification/_json_spec/ml.delete_trained_model.json index b9996c193f..daf0b83ee7 100644 --- a/specification/_json_spec/ml.delete_trained_model.json +++ b/specification/_json_spec/ml.delete_trained_model.json @@ -26,13 +26,11 @@ "params": { "timeout": { "type": "time", - "required": false, "description": "Controls the amount of time to wait for the model to be deleted.", "default": "30s" }, "force": { "type": "boolean", - "required": false, "description": "True if the model should be forcefully deleted" } } diff --git a/specification/_json_spec/ml.forecast.json b/specification/_json_spec/ml.forecast.json index 82017a1648..ab562e094e 100644 --- a/specification/_json_spec/ml.forecast.json +++ b/specification/_json_spec/ml.forecast.json @@ -27,17 +27,14 @@ "params": { "duration": { "type": "time", - "required": false, "description": "The duration of the forecast" }, "expires_in": { "type": "time", - "required": false, "description": "The time interval after which the forecast expires. Expired forecasts will be deleted at the first opportunity." }, "max_model_memory": { "type": "string", - "required": false, "description": "The max memory able to be used by the forecast. Default is 20mb." } }, diff --git a/specification/_json_spec/ml.get_data_frame_analytics.json b/specification/_json_spec/ml.get_data_frame_analytics.json index c6a5623fe1..56a2544fac 100644 --- a/specification/_json_spec/ml.get_data_frame_analytics.json +++ b/specification/_json_spec/ml.get_data_frame_analytics.json @@ -30,7 +30,6 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)", "default": true }, @@ -45,7 +44,6 @@ "default": 100 }, "exclude_generated": { - "required": false, "type": "boolean", "default": false, "description": "Omits fields that are illegal to set on data frame analytics PUT" diff --git a/specification/_json_spec/ml.get_data_frame_analytics_stats.json b/specification/_json_spec/ml.get_data_frame_analytics_stats.json index 5f455a1fab..06f1eca928 100644 --- a/specification/_json_spec/ml.get_data_frame_analytics_stats.json +++ b/specification/_json_spec/ml.get_data_frame_analytics_stats.json @@ -30,7 +30,6 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)", "default": true }, @@ -46,7 +45,6 @@ }, "verbose": { "type": "boolean", - "required": false, "description": "whether the stats response should be verbose", "default": false } diff --git a/specification/_json_spec/ml.get_datafeed_stats.json b/specification/_json_spec/ml.get_datafeed_stats.json index d96770b94e..f89efe2200 100644 --- a/specification/_json_spec/ml.get_datafeed_stats.json +++ b/specification/_json_spec/ml.get_datafeed_stats.json @@ -30,7 +30,6 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" } } diff --git a/specification/_json_spec/ml.get_datafeeds.json b/specification/_json_spec/ml.get_datafeeds.json index b635910d17..dc33d432ff 100644 --- a/specification/_json_spec/ml.get_datafeeds.json +++ b/specification/_json_spec/ml.get_datafeeds.json @@ -30,11 +30,9 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" }, "exclude_generated": { - "required": false, "type": "boolean", "default": false, "description": "Omits fields that are illegal to set on datafeed PUT" diff --git a/specification/_json_spec/ml.get_job_stats.json b/specification/_json_spec/ml.get_job_stats.json index 7eba509b7e..f45d9cb9f7 100644 --- a/specification/_json_spec/ml.get_job_stats.json +++ b/specification/_json_spec/ml.get_job_stats.json @@ -30,7 +30,6 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" } } diff --git a/specification/_json_spec/ml.get_jobs.json b/specification/_json_spec/ml.get_jobs.json index 0bb11fee46..2ad5df0f9b 100644 --- a/specification/_json_spec/ml.get_jobs.json +++ b/specification/_json_spec/ml.get_jobs.json @@ -30,11 +30,9 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no jobs. (This includes `_all` string or when no jobs have been specified)" }, "exclude_generated": { - "required": false, "type": "boolean", "default": false, "description": "Omits fields that are illegal to set on job PUT" diff --git a/specification/_json_spec/ml.get_memory_stats.json b/specification/_json_spec/ml.get_memory_stats.json index a3260c8ca0..08e88e89ac 100644 --- a/specification/_json_spec/ml.get_memory_stats.json +++ b/specification/_json_spec/ml.get_memory_stats.json @@ -30,6 +30,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/ml.get_model_snapshot_upgrade_stats.json b/specification/_json_spec/ml.get_model_snapshot_upgrade_stats.json index 559f28ab04..d868fa96e3 100644 --- a/specification/_json_spec/ml.get_model_snapshot_upgrade_stats.json +++ b/specification/_json_spec/ml.get_model_snapshot_upgrade_stats.json @@ -30,7 +30,6 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no jobs or no snapshots. (This includes the `_all` string.)" } } diff --git a/specification/_json_spec/ml.get_trained_models.json b/specification/_json_spec/ml.get_trained_models.json index b37a5df8e2..d48c5054f5 100644 --- a/specification/_json_spec/ml.get_trained_models.json +++ b/specification/_json_spec/ml.get_trained_models.json @@ -30,40 +30,33 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified)", "default": true }, "include": { "type": "string", - "required": false, "description": "A comma-separate list of fields to optionally include. Valid options are 'definition' and 'total_feature_importance'. Default is none." }, "decompress_definition": { "type": "boolean", - "required": false, "default": true, "description": "Should the model definition be decompressed into valid JSON or returned in a custom compressed format. Defaults to true." }, "from": { - "required": false, "type": "int", "description": "skips a number of trained models", "default": 0 }, "size": { - "required": false, "type": "int", "description": "specifies a max number of trained models to get", "default": 100 }, "tags": { - "required": false, "type": "list", "description": "A comma-separated list of tags that the model must have." }, "exclude_generated": { - "required": false, "type": "boolean", "default": false, "description": "Omits fields that are illegal to set on model PUT" diff --git a/specification/_json_spec/ml.get_trained_models_stats.json b/specification/_json_spec/ml.get_trained_models_stats.json index 23542a2d4a..41f5f40180 100644 --- a/specification/_json_spec/ml.get_trained_models_stats.json +++ b/specification/_json_spec/ml.get_trained_models_stats.json @@ -30,7 +30,6 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no trained models. (This includes `_all` string or when no trained models have been specified)", "default": true }, diff --git a/specification/_json_spec/ml.infer_trained_model.json b/specification/_json_spec/ml.infer_trained_model.json index e2ae1f05f9..b3461333c6 100644 --- a/specification/_json_spec/ml.infer_trained_model.json +++ b/specification/_json_spec/ml.infer_trained_model.json @@ -28,7 +28,6 @@ "params": { "timeout": { "type": "time", - "required": false, "description": "Controls the amount of time to wait for inference results.", "default": "10s" } diff --git a/specification/_json_spec/ml.preview_datafeed.json b/specification/_json_spec/ml.preview_datafeed.json index 17e3a1efdf..e6f29b9963 100644 --- a/specification/_json_spec/ml.preview_datafeed.json +++ b/specification/_json_spec/ml.preview_datafeed.json @@ -31,12 +31,10 @@ "params": { "start": { "type": "string", - "required": false, "description": "The start time from where the datafeed preview should begin" }, "end": { "type": "string", - "required": false, "description": "The end time when the datafeed preview should stop" } }, diff --git a/specification/_json_spec/ml.put_trained_model.json b/specification/_json_spec/ml.put_trained_model.json index 5807280337..da873e35ee 100644 --- a/specification/_json_spec/ml.put_trained_model.json +++ b/specification/_json_spec/ml.put_trained_model.json @@ -26,13 +26,11 @@ }, "params": { "defer_definition_decompression": { - "required": false, "type": "boolean", "description": "If set to `true` and a `compressed_definition` is provided, the request defers definition decompression and skips relevant validations.", "default": false }, "wait_for_completion": { - "required": false, "type": "boolean", "description": "Whether to wait for all child operations(e.g. model download) to complete, before returning or not. Default to false", "default": false diff --git a/specification/_json_spec/ml.start_data_frame_analytics.json b/specification/_json_spec/ml.start_data_frame_analytics.json index 7eb86979ce..51691d753d 100644 --- a/specification/_json_spec/ml.start_data_frame_analytics.json +++ b/specification/_json_spec/ml.start_data_frame_analytics.json @@ -27,7 +27,6 @@ "params": { "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait until the task has started. Defaults to 20 seconds" } }, diff --git a/specification/_json_spec/ml.start_datafeed.json b/specification/_json_spec/ml.start_datafeed.json index 7da8c4fa19..4d0b07ddf2 100644 --- a/specification/_json_spec/ml.start_datafeed.json +++ b/specification/_json_spec/ml.start_datafeed.json @@ -27,17 +27,14 @@ "params": { "start": { "type": "string", - "required": false, "description": "The start time from where the datafeed should begin" }, "end": { "type": "string", - "required": false, "description": "The end time when the datafeed should stop. When not set, the datafeed continues in real time" }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait until a datafeed has started. Default to 20 seconds" } }, diff --git a/specification/_json_spec/ml.start_trained_model_deployment.json b/specification/_json_spec/ml.start_trained_model_deployment.json index d072c8462c..b5d4f8a7ec 100644 --- a/specification/_json_spec/ml.start_trained_model_deployment.json +++ b/specification/_json_spec/ml.start_trained_model_deployment.json @@ -28,47 +28,39 @@ "params": { "cache_size": { "type": "string", - "description": "A byte-size value for configuring the inference cache size. For example, 20mb.", - "required": false + "description": "A byte-size value for configuring the inference cache size. For example, 20mb." }, "deployment_id": { "type": "string", - "description": "The Id of the new deployment. Defaults to the model_id if not set.", - "required": false + "description": "The Id of the new deployment. Defaults to the model_id if not set." }, "number_of_allocations": { "type": "int", "description": "The total number of allocations this model is assigned across machine learning nodes.", - "required": false, "default": 1 }, "threads_per_allocation": { "type": "int", "description": "The number of threads used by each model allocation during inference.", - "required": false, "default": 1 }, "priority": { "type": "string", "description": "The deployment priority.", - "required": false, "default": "normal" }, "queue_capacity": { "type": "int", "description": "Controls how many inference requests are allowed in the queue at a time.", - "required": false, "default": 1024 }, "timeout": { "type": "time", - "required": false, "description": "Controls the amount of time to wait for the model to deploy.", "default": "20s" }, "wait_for": { "type": "string", - "required": false, "description": "The allocation status for which to wait", "options": ["starting", "started", "fully_allocated"], "default": "started" diff --git a/specification/_json_spec/ml.stop_data_frame_analytics.json b/specification/_json_spec/ml.stop_data_frame_analytics.json index 89f262a66e..21d470ec10 100644 --- a/specification/_json_spec/ml.stop_data_frame_analytics.json +++ b/specification/_json_spec/ml.stop_data_frame_analytics.json @@ -27,17 +27,14 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no data frame analytics. (This includes `_all` string or when no data frame analytics have been specified)" }, "force": { "type": "boolean", - "required": false, "description": "True if the data frame analytics should be forcefully stopped" }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait until the task has stopped. Defaults to 20 seconds" } }, diff --git a/specification/_json_spec/ml.stop_datafeed.json b/specification/_json_spec/ml.stop_datafeed.json index 325a420d4f..80dca45888 100644 --- a/specification/_json_spec/ml.stop_datafeed.json +++ b/specification/_json_spec/ml.stop_datafeed.json @@ -27,17 +27,14 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no datafeeds. (This includes `_all` string or when no datafeeds have been specified)" }, "force": { "type": "boolean", - "required": false, "description": "True if the datafeed should be forcefully stopped." }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait until a datafeed has stopped. Default to 20 seconds" } }, diff --git a/specification/_json_spec/ml.stop_trained_model_deployment.json b/specification/_json_spec/ml.stop_trained_model_deployment.json index e2129f0b51..ecc6dc1628 100644 --- a/specification/_json_spec/ml.stop_trained_model_deployment.json +++ b/specification/_json_spec/ml.stop_trained_model_deployment.json @@ -28,12 +28,10 @@ "params": { "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no deployments. (This includes `_all` string or when no deployments have been specified)" }, "force": { "type": "boolean", - "required": false, "description": "True if the deployment should be forcefully stopped" } }, diff --git a/specification/_json_spec/ml.update_trained_model_deployment.json b/specification/_json_spec/ml.update_trained_model_deployment.json index f8ccb10079..94476779a1 100644 --- a/specification/_json_spec/ml.update_trained_model_deployment.json +++ b/specification/_json_spec/ml.update_trained_model_deployment.json @@ -27,7 +27,6 @@ "params": { "number_of_allocations": { "type": "int", - "required": false, "description": "Update the model deployment to this number of allocations." } }, diff --git a/specification/_json_spec/ml.upgrade_job_snapshot.json b/specification/_json_spec/ml.upgrade_job_snapshot.json index e0463b6e49..afc1b3a1e1 100644 --- a/specification/_json_spec/ml.upgrade_job_snapshot.json +++ b/specification/_json_spec/ml.upgrade_job_snapshot.json @@ -30,12 +30,10 @@ "params": { "timeout": { "type": "time", - "required": false, "description": "How long should the API wait for the job to be opened and the old snapshot to be loaded." }, "wait_for_completion": { "type": "boolean", - "required": false, "description": "Should the request wait until the task is complete before responding to the caller. Default is false." } } diff --git a/specification/_json_spec/profiling.status.json b/specification/_json_spec/profiling.status.json index 1bdb52125f..68a76d9cfd 100644 --- a/specification/_json_spec/profiling.status.json +++ b/specification/_json_spec/profiling.status.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/put_script.json b/specification/_json_spec/put_script.json index 4cd841281e..ecc7feadba 100644 --- a/specification/_json_spec/put_script.json +++ b/specification/_json_spec/put_script.json @@ -45,6 +45,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" }, "context": { diff --git a/specification/_json_spec/rollup.stop_job.json b/specification/_json_spec/rollup.stop_job.json index ec0d5c1af3..c414699da5 100644 --- a/specification/_json_spec/rollup.stop_job.json +++ b/specification/_json_spec/rollup.stop_job.json @@ -26,12 +26,10 @@ "params": { "wait_for_completion": { "type": "boolean", - "required": false, "description": "True if the API should block until the job has fully stopped, false if should be executed async. Defaults to false." }, "timeout": { "type": "time", - "required": false, "description": "Block for (at maximum) the specified duration while waiting for the job to stop. Defaults to 30s." } } diff --git a/specification/_json_spec/search_shards.json b/specification/_json_spec/search_shards.json index 7f4bab9bf7..d6ff71c665 100644 --- a/specification/_json_spec/search_shards.json +++ b/specification/_json_spec/search_shards.json @@ -56,6 +56,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } } diff --git a/specification/_json_spec/searchable_snapshots.mount.json b/specification/_json_spec/searchable_snapshots.mount.json index 818477d204..64fb277781 100644 --- a/specification/_json_spec/searchable_snapshots.mount.json +++ b/specification/_json_spec/searchable_snapshots.mount.json @@ -31,6 +31,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "wait_for_completion": { diff --git a/specification/_json_spec/security.clear_cached_realms.json b/specification/_json_spec/security.clear_cached_realms.json index 5b4e06f0b7..98337763c4 100644 --- a/specification/_json_spec/security.clear_cached_realms.json +++ b/specification/_json_spec/security.clear_cached_realms.json @@ -26,8 +26,7 @@ "params": { "usernames": { "type": "list", - "description": "Comma-separated list of usernames to clear from the cache", - "required": false + "description": "Comma-separated list of usernames to clear from the cache" } } } diff --git a/specification/_json_spec/security.get_settings.json b/specification/_json_spec/security.get_settings.json index 193b47b6d5..1f46e9f79f 100644 --- a/specification/_json_spec/security.get_settings.json +++ b/specification/_json_spec/security.get_settings.json @@ -21,6 +21,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for connection to master" } } diff --git a/specification/_json_spec/security.update_settings.json b/specification/_json_spec/security.update_settings.json index 72fdf25bdb..bae094e2c8 100644 --- a/specification/_json_spec/security.update_settings.json +++ b/specification/_json_spec/security.update_settings.json @@ -21,6 +21,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for connection to master" }, "timeout": { diff --git a/specification/_json_spec/shutdown.delete_node.json b/specification/_json_spec/shutdown.delete_node.json index 21a1b5ffbb..2a562165e5 100644 --- a/specification/_json_spec/shutdown.delete_node.json +++ b/specification/_json_spec/shutdown.delete_node.json @@ -27,6 +27,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/shutdown.get_node.json b/specification/_json_spec/shutdown.get_node.json index 446f2a370e..82c82632e1 100644 --- a/specification/_json_spec/shutdown.get_node.json +++ b/specification/_json_spec/shutdown.get_node.json @@ -32,6 +32,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" } } diff --git a/specification/_json_spec/shutdown.put_node.json b/specification/_json_spec/shutdown.put_node.json index fd30ae1c4c..9252c446e2 100644 --- a/specification/_json_spec/shutdown.put_node.json +++ b/specification/_json_spec/shutdown.put_node.json @@ -27,6 +27,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/slm.delete_lifecycle.json b/specification/_json_spec/slm.delete_lifecycle.json index 2f651f027e..ccaf6221b3 100644 --- a/specification/_json_spec/slm.delete_lifecycle.json +++ b/specification/_json_spec/slm.delete_lifecycle.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/slm.execute_lifecycle.json b/specification/_json_spec/slm.execute_lifecycle.json index 59c58b90c8..9cfb1ae961 100644 --- a/specification/_json_spec/slm.execute_lifecycle.json +++ b/specification/_json_spec/slm.execute_lifecycle.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/slm.execute_retention.json b/specification/_json_spec/slm.execute_retention.json index 44a1af3ec9..8221c7a197 100644 --- a/specification/_json_spec/slm.execute_retention.json +++ b/specification/_json_spec/slm.execute_retention.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/slm.get_lifecycle.json b/specification/_json_spec/slm.get_lifecycle.json index f9579daff4..bab5b713a4 100644 --- a/specification/_json_spec/slm.get_lifecycle.json +++ b/specification/_json_spec/slm.get_lifecycle.json @@ -30,6 +30,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/slm.get_stats.json b/specification/_json_spec/slm.get_stats.json index 898a3c8e03..6a34108b6d 100644 --- a/specification/_json_spec/slm.get_stats.json +++ b/specification/_json_spec/slm.get_stats.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/slm.get_status.json b/specification/_json_spec/slm.get_status.json index 9466510153..daf47b45c4 100644 --- a/specification/_json_spec/slm.get_status.json +++ b/specification/_json_spec/slm.get_status.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/slm.put_lifecycle.json b/specification/_json_spec/slm.put_lifecycle.json index 1df0f1f64c..c3d2114251 100644 --- a/specification/_json_spec/slm.put_lifecycle.json +++ b/specification/_json_spec/slm.put_lifecycle.json @@ -27,6 +27,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/slm.start.json b/specification/_json_spec/slm.start.json index 42fcacc306..b134589253 100644 --- a/specification/_json_spec/slm.start.json +++ b/specification/_json_spec/slm.start.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" }, "timeout": { diff --git a/specification/_json_spec/slm.stop.json b/specification/_json_spec/slm.stop.json index d20a46473e..cc7f36635a 100644 --- a/specification/_json_spec/slm.stop.json +++ b/specification/_json_spec/slm.stop.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Timeout for processing on master node" }, "timeout": { diff --git a/specification/_json_spec/snapshot.cleanup_repository.json b/specification/_json_spec/snapshot.cleanup_repository.json index 34d032f469..86bc30373d 100644 --- a/specification/_json_spec/snapshot.cleanup_repository.json +++ b/specification/_json_spec/snapshot.cleanup_repository.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/snapshot.clone.json b/specification/_json_spec/snapshot.clone.json index 7bf57eeb8c..5a4a65bb99 100644 --- a/specification/_json_spec/snapshot.clone.json +++ b/specification/_json_spec/snapshot.clone.json @@ -35,6 +35,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" } }, diff --git a/specification/_json_spec/snapshot.create.json b/specification/_json_spec/snapshot.create.json index c80639c221..6c2c7bfbe4 100644 --- a/specification/_json_spec/snapshot.create.json +++ b/specification/_json_spec/snapshot.create.json @@ -31,6 +31,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "wait_for_completion": { diff --git a/specification/_json_spec/snapshot.create_repository.json b/specification/_json_spec/snapshot.create_repository.json index 1d234c1dda..187b978850 100644 --- a/specification/_json_spec/snapshot.create_repository.json +++ b/specification/_json_spec/snapshot.create_repository.json @@ -27,6 +27,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/snapshot.delete.json b/specification/_json_spec/snapshot.delete.json index edff8bb28d..30de2cfa34 100644 --- a/specification/_json_spec/snapshot.delete.json +++ b/specification/_json_spec/snapshot.delete.json @@ -30,6 +30,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "wait_for_completion": { diff --git a/specification/_json_spec/snapshot.delete_repository.json b/specification/_json_spec/snapshot.delete_repository.json index b87d3d63f3..aeb6360a03 100644 --- a/specification/_json_spec/snapshot.delete_repository.json +++ b/specification/_json_spec/snapshot.delete_repository.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/snapshot.get.json b/specification/_json_spec/snapshot.get.json index fa07b7bf49..9e3c11f1b2 100644 --- a/specification/_json_spec/snapshot.get.json +++ b/specification/_json_spec/snapshot.get.json @@ -30,6 +30,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "ignore_unavailable": { diff --git a/specification/_json_spec/snapshot.get_repository.json b/specification/_json_spec/snapshot.get_repository.json index 8afb9689a9..670c91cc86 100644 --- a/specification/_json_spec/snapshot.get_repository.json +++ b/specification/_json_spec/snapshot.get_repository.json @@ -30,6 +30,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "local": { diff --git a/specification/_json_spec/snapshot.restore.json b/specification/_json_spec/snapshot.restore.json index e521ac00be..280df5a9d6 100644 --- a/specification/_json_spec/snapshot.restore.json +++ b/specification/_json_spec/snapshot.restore.json @@ -31,6 +31,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "wait_for_completion": { diff --git a/specification/_json_spec/snapshot.status.json b/specification/_json_spec/snapshot.status.json index 477317b76d..a1ffc026ab 100644 --- a/specification/_json_spec/snapshot.status.json +++ b/specification/_json_spec/snapshot.status.json @@ -44,6 +44,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "ignore_unavailable": { diff --git a/specification/_json_spec/snapshot.verify_repository.json b/specification/_json_spec/snapshot.verify_repository.json index 8da0e72cf7..f4b320a680 100644 --- a/specification/_json_spec/snapshot.verify_repository.json +++ b/specification/_json_spec/snapshot.verify_repository.json @@ -26,6 +26,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Explicit operation timeout for connection to master node" }, "timeout": { diff --git a/specification/_json_spec/streams.logs_disable.json b/specification/_json_spec/streams.logs_disable.json index 1b540296b1..8ac525142a 100644 --- a/specification/_json_spec/streams.logs_disable.json +++ b/specification/_json_spec/streams.logs_disable.json @@ -25,6 +25,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "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." } } diff --git a/specification/_json_spec/streams.logs_enable.json b/specification/_json_spec/streams.logs_enable.json index b6ce3af45f..7438879c65 100644 --- a/specification/_json_spec/streams.logs_enable.json +++ b/specification/_json_spec/streams.logs_enable.json @@ -25,6 +25,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "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." } } diff --git a/specification/_json_spec/transform.delete_transform.json b/specification/_json_spec/transform.delete_transform.json index 0c8d2ea58a..ac7fade471 100644 --- a/specification/_json_spec/transform.delete_transform.json +++ b/specification/_json_spec/transform.delete_transform.json @@ -26,17 +26,14 @@ "params": { "force": { "type": "boolean", - "required": false, "description": "When `true`, the transform is deleted regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be deleted." }, "delete_dest_index": { "type": "boolean", - "required": false, "description": "When `true`, the destination index is deleted together with the transform. The default value is `false`, meaning that the destination index will not be deleted." }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait for the transform deletion" } } diff --git a/specification/_json_spec/transform.get_transform.json b/specification/_json_spec/transform.get_transform.json index 835264067b..c6f9adbc71 100644 --- a/specification/_json_spec/transform.get_transform.json +++ b/specification/_json_spec/transform.get_transform.json @@ -30,21 +30,17 @@ "params": { "from": { "type": "int", - "required": false, "description": "skips a number of transform configs, defaults to 0" }, "size": { "type": "int", - "required": false, "description": "specifies a max number of transforms to get, defaults to 100" }, "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)" }, "exclude_generated": { - "required": false, "type": "boolean", "default": false, "description": "Omits fields that are illegal to set on transform PUT" diff --git a/specification/_json_spec/transform.get_transform_stats.json b/specification/_json_spec/transform.get_transform_stats.json index 604be01f72..83e6b5146f 100644 --- a/specification/_json_spec/transform.get_transform_stats.json +++ b/specification/_json_spec/transform.get_transform_stats.json @@ -26,22 +26,18 @@ "params": { "from": { "type": "number", - "required": false, "description": "skips a number of transform stats, defaults to 0" }, "size": { "type": "number", - "required": false, "description": "specifies a max number of transform stats to get, defaults to 100" }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait for the stats" }, "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)" } } diff --git a/specification/_json_spec/transform.preview_transform.json b/specification/_json_spec/transform.preview_transform.json index ec2b37e5d3..f624b2f746 100644 --- a/specification/_json_spec/transform.preview_transform.json +++ b/specification/_json_spec/transform.preview_transform.json @@ -31,7 +31,6 @@ "params": { "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait for the preview" } }, diff --git a/specification/_json_spec/transform.put_transform.json b/specification/_json_spec/transform.put_transform.json index f9fc20f58f..7e9ca901cc 100644 --- a/specification/_json_spec/transform.put_transform.json +++ b/specification/_json_spec/transform.put_transform.json @@ -27,12 +27,10 @@ "params": { "defer_validation": { "type": "boolean", - "required": false, "description": "If validations should be deferred until transform starts, defaults to false." }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait for the transform to start" } }, diff --git a/specification/_json_spec/transform.reset_transform.json b/specification/_json_spec/transform.reset_transform.json index d6af5d6167..ab5baf3fbb 100644 --- a/specification/_json_spec/transform.reset_transform.json +++ b/specification/_json_spec/transform.reset_transform.json @@ -26,12 +26,10 @@ "params": { "force": { "type": "boolean", - "required": false, "description": "When `true`, the transform is reset regardless of its current state. The default value is `false`, meaning that the transform must be `stopped` before it can be reset." }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait for the transform to reset" } } diff --git a/specification/_json_spec/transform.schedule_now_transform.json b/specification/_json_spec/transform.schedule_now_transform.json index fbfaf2935b..77bcb04923 100644 --- a/specification/_json_spec/transform.schedule_now_transform.json +++ b/specification/_json_spec/transform.schedule_now_transform.json @@ -28,7 +28,6 @@ "params": { "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait for the scheduling to take place" } } diff --git a/specification/_json_spec/transform.start_transform.json b/specification/_json_spec/transform.start_transform.json index c8f85d1edb..a7759fe7fb 100644 --- a/specification/_json_spec/transform.start_transform.json +++ b/specification/_json_spec/transform.start_transform.json @@ -26,12 +26,10 @@ "params": { "from": { "type": "string", - "required": false, "description": "Restricts the set of transformed entities to those changed after this time" }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait for the transform to start" } } diff --git a/specification/_json_spec/transform.stop_transform.json b/specification/_json_spec/transform.stop_transform.json index 4917c198e2..768ee7c0d1 100644 --- a/specification/_json_spec/transform.stop_transform.json +++ b/specification/_json_spec/transform.stop_transform.json @@ -26,27 +26,22 @@ "params": { "force": { "type": "boolean", - "required": false, "description": "Whether to force stop a failed transform or not. Default to false" }, "wait_for_completion": { "type": "boolean", - "required": false, "description": "Whether to wait for the transform to fully stop before returning or not. Default to false" }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait until the transform has stopped. Default to 30 seconds" }, "allow_no_match": { "type": "boolean", - "required": false, "description": "Whether to ignore if a wildcard expression matches no transforms. (This includes `_all` string or when no transforms have been specified)" }, "wait_for_checkpoint": { "type": "boolean", - "required": false, "description": "Whether to wait for the transform to reach a checkpoint before stopping. Default to false" } } diff --git a/specification/_json_spec/transform.update_transform.json b/specification/_json_spec/transform.update_transform.json index 88a48f0bd6..ce427bec73 100644 --- a/specification/_json_spec/transform.update_transform.json +++ b/specification/_json_spec/transform.update_transform.json @@ -28,12 +28,10 @@ "params": { "defer_validation": { "type": "boolean", - "required": false, "description": "If validations should be deferred until transform starts, defaults to false." }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait for the update" } }, diff --git a/specification/_json_spec/transform.upgrade_transforms.json b/specification/_json_spec/transform.upgrade_transforms.json index 93e902bef4..e53ddd4271 100644 --- a/specification/_json_spec/transform.upgrade_transforms.json +++ b/specification/_json_spec/transform.upgrade_transforms.json @@ -21,12 +21,10 @@ "params": { "dry_run": { "type": "boolean", - "required": false, "description": "Whether to only check for updates but don't execute" }, "timeout": { "type": "time", - "required": false, "description": "Controls the time to wait for the upgrade" } } diff --git a/specification/_json_spec/watcher.execute_watch.json b/specification/_json_spec/watcher.execute_watch.json index f2039a311e..35d4b695e6 100644 --- a/specification/_json_spec/watcher.execute_watch.json +++ b/specification/_json_spec/watcher.execute_watch.json @@ -31,8 +31,7 @@ "params": { "debug": { "type": "boolean", - "description": "indicates whether the watch should execute in debug mode", - "required": false + "description": "indicates whether the watch should execute in debug mode" } }, "body": { diff --git a/specification/_json_spec/watcher.get_settings.json b/specification/_json_spec/watcher.get_settings.json index bb78f18e7c..8e68f9bc41 100644 --- a/specification/_json_spec/watcher.get_settings.json +++ b/specification/_json_spec/watcher.get_settings.json @@ -21,6 +21,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/watcher.start.json b/specification/_json_spec/watcher.start.json index 0f681724ec..3e85fb7ad0 100644 --- a/specification/_json_spec/watcher.start.json +++ b/specification/_json_spec/watcher.start.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/watcher.stats.json b/specification/_json_spec/watcher.stats.json index 0d7cf60fc5..034dd70254 100644 --- a/specification/_json_spec/watcher.stats.json +++ b/specification/_json_spec/watcher.stats.json @@ -46,8 +46,7 @@ }, "emit_stacktraces": { "type": "boolean", - "description": "Emits stack traces of currently running watches", - "required": false + "description": "Emits stack traces of currently running watches" } } } diff --git a/specification/_json_spec/watcher.stop.json b/specification/_json_spec/watcher.stop.json index d9681656c1..b0c379ccf3 100644 --- a/specification/_json_spec/watcher.stop.json +++ b/specification/_json_spec/watcher.stop.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } } diff --git a/specification/_json_spec/watcher.update_settings.json b/specification/_json_spec/watcher.update_settings.json index bccd0cc9ec..f23ac7ccf4 100644 --- a/specification/_json_spec/watcher.update_settings.json +++ b/specification/_json_spec/watcher.update_settings.json @@ -25,6 +25,7 @@ }, "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for connection to master" } }, diff --git a/specification/_json_spec/xpack.info.json b/specification/_json_spec/xpack.info.json index 777f76b835..b1e11ae4cc 100644 --- a/specification/_json_spec/xpack.info.json +++ b/specification/_json_spec/xpack.info.json @@ -20,7 +20,6 @@ "params": { "human": { "type": "boolean", - "required": false, "description": "Defines whether additional human-readable information is included in the response. In particular, it adds descriptions and a tag line. The default value is true.", "default": true }, diff --git a/specification/_json_spec/xpack.usage.json b/specification/_json_spec/xpack.usage.json index 48df8238d3..4fe4a77499 100644 --- a/specification/_json_spec/xpack.usage.json +++ b/specification/_json_spec/xpack.usage.json @@ -20,6 +20,7 @@ "params": { "master_timeout": { "type": "time", + "default": "30s", "description": "Specify timeout for watch write operation" } } From 99bc575ce1d86378bcef44b5c1f5ee16683ee779 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 15:38:10 +0400 Subject: [PATCH 23/26] Update rest-api-spec (#5311) Co-authored-by: pquentin <42327+pquentin@users.noreply.github.com> --- output/schema/validation-errors.json | 116 ------------------ specification/_json_spec/cat.aliases.json | 10 ++ specification/_json_spec/cat.allocation.json | 5 + .../_json_spec/cat.component_templates.json | 10 ++ specification/_json_spec/cat.count.json | 10 ++ specification/_json_spec/cat.fielddata.json | 5 + specification/_json_spec/cat.health.json | 5 + specification/_json_spec/cat.master.json | 10 ++ .../_json_spec/cat.ml_datafeeds.json | 5 + specification/_json_spec/cat.nodeattrs.json | 10 ++ .../_json_spec/cat.pending_tasks.json | 5 + specification/_json_spec/cat.plugins.json | 10 ++ .../_json_spec/cat.repositories.json | 10 ++ specification/_json_spec/cat.segments.json | 5 + specification/_json_spec/cat.snapshots.json | 5 + specification/_json_spec/cat.tasks.json | 5 + specification/_json_spec/cat.templates.json | 10 ++ specification/_json_spec/cat.thread_pool.json | 5 + specification/_json_spec/cat.transforms.json | 5 + 19 files changed, 130 insertions(+), 116 deletions(-) diff --git a/output/schema/validation-errors.json b/output/schema/validation-errors.json index 05256be8e3..34717a8197 100644 --- a/output/schema/validation-errors.json +++ b/output/schema/validation-errors.json @@ -1,121 +1,5 @@ { "endpointErrors": { - "cat.aliases": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec", - "Request: query parameter 'time' does not exist in the json spec" - ], - "response": [] - }, - "cat.allocation": { - "request": [ - "Request: query parameter 'time' does not exist in the json spec" - ], - "response": [] - }, - "cat.component_templates": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec", - "Request: query parameter 'time' does not exist in the json spec" - ], - "response": [] - }, - "cat.count": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec", - "Request: query parameter 'time' does not exist in the json spec" - ], - "response": [] - }, - "cat.fielddata": { - "request": [ - "Request: query parameter 'time' does not exist in the json spec" - ], - "response": [] - }, - "cat.health": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec" - ], - "response": [] - }, - "cat.master": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec", - "Request: query parameter 'time' does not exist in the json spec" - ], - "response": [] - }, - "cat.ml_datafeeds": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec" - ], - "response": [] - }, - "cat.nodeattrs": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec", - "Request: query parameter 'time' does not exist in the json spec" - ], - "response": [] - }, - "cat.pending_tasks": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec" - ], - "response": [] - }, - "cat.plugins": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec", - "Request: query parameter 'time' does not exist in the json spec" - ], - "response": [] - }, - "cat.repositories": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec", - "Request: query parameter 'time' does not exist in the json spec" - ], - "response": [] - }, - "cat.segments": { - "request": [ - "Request: query parameter 'time' does not exist in the json spec" - ], - "response": [] - }, - "cat.snapshots": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec" - ], - "response": [] - }, - "cat.tasks": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec" - ], - "response": [] - }, - "cat.templates": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec", - "Request: query parameter 'time' does not exist in the json spec" - ], - "response": [] - }, - "cat.thread_pool": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec" - ], - "response": [] - }, - "cat.transforms": { - "request": [ - "Request: query parameter 'bytes' does not exist in the json spec" - ], - "response": [] - }, "streams.status": { "request": [ "Request: query parameter 'master_timeout' does not exist in the json spec", diff --git a/specification/_json_spec/cat.aliases.json b/specification/_json_spec/cat.aliases.json index e69f2abc0e..9fc78fd6fd 100644 --- a/specification/_json_spec/cat.aliases.json +++ b/specification/_json_spec/cat.aliases.json @@ -61,6 +61,16 @@ "type": "time", "default": "30s", "description": "Timeout for waiting for new cluster state in case it is blocked" + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] + }, + "time": { + "type": "enum", + "description": "The unit in which to display time values", + "options": ["d", "h", "m", "s", "ms", "micros", "nanos"] } } } diff --git a/specification/_json_spec/cat.allocation.json b/specification/_json_spec/cat.allocation.json index b8a5f1da01..e9619ba60d 100644 --- a/specification/_json_spec/cat.allocation.json +++ b/specification/_json_spec/cat.allocation.json @@ -38,6 +38,11 @@ "description": "The unit in which to display byte values", "options": ["b", "kb", "mb", "gb", "tb", "pb"] }, + "time": { + "type": "enum", + "description": "The unit in which to display time values", + "options": ["d", "h", "m", "s", "ms", "micros", "nanos"] + }, "local": { "type": "boolean", "description": "Return local information, do not retrieve the state from master node (default: false)" diff --git a/specification/_json_spec/cat.component_templates.json b/specification/_json_spec/cat.component_templates.json index d55bce0775..307d6bb2b1 100644 --- a/specification/_json_spec/cat.component_templates.json +++ b/specification/_json_spec/cat.component_templates.json @@ -59,6 +59,16 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] + }, + "time": { + "type": "enum", + "description": "The unit in which to display time values", + "options": ["d", "h", "m", "s", "ms", "micros", "nanos"] } } } diff --git a/specification/_json_spec/cat.count.json b/specification/_json_spec/cat.count.json index ef88d10f74..fc77804834 100644 --- a/specification/_json_spec/cat.count.json +++ b/specification/_json_spec/cat.count.json @@ -50,6 +50,16 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] + }, + "time": { + "type": "enum", + "description": "The unit in which to display time values", + "options": ["d", "h", "m", "s", "ms", "micros", "nanos"] } } } diff --git a/specification/_json_spec/cat.fielddata.json b/specification/_json_spec/cat.fielddata.json index 8630374a38..d99f49cfd0 100644 --- a/specification/_json_spec/cat.fielddata.json +++ b/specification/_json_spec/cat.fielddata.json @@ -59,6 +59,11 @@ "fields": { "type": "list", "description": "A comma-separated list of fields to return in the output" + }, + "time": { + "type": "enum", + "description": "The unit in which to display time values", + "options": ["d", "h", "m", "s", "ms", "micros", "nanos"] } } } diff --git a/specification/_json_spec/cat.health.json b/specification/_json_spec/cat.health.json index b540a6dc6a..2d421cbfbf 100644 --- a/specification/_json_spec/cat.health.json +++ b/specification/_json_spec/cat.health.json @@ -50,6 +50,11 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] } } } diff --git a/specification/_json_spec/cat.master.json b/specification/_json_spec/cat.master.json index 2fa72a5201..beba459f17 100644 --- a/specification/_json_spec/cat.master.json +++ b/specification/_json_spec/cat.master.json @@ -49,6 +49,16 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] + }, + "time": { + "type": "enum", + "description": "The unit in which to display time values", + "options": ["d", "h", "m", "s", "ms", "micros", "nanos"] } } } diff --git a/specification/_json_spec/cat.ml_datafeeds.json b/specification/_json_spec/cat.ml_datafeeds.json index 72e0edd2ff..3cc24754f3 100644 --- a/specification/_json_spec/cat.ml_datafeeds.json +++ b/specification/_json_spec/cat.ml_datafeeds.json @@ -59,6 +59,11 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] } } } diff --git a/specification/_json_spec/cat.nodeattrs.json b/specification/_json_spec/cat.nodeattrs.json index 88760181fa..1f6931aa5a 100644 --- a/specification/_json_spec/cat.nodeattrs.json +++ b/specification/_json_spec/cat.nodeattrs.json @@ -49,6 +49,16 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] + }, + "time": { + "type": "enum", + "description": "The unit in which to display time values", + "options": ["d", "h", "m", "s", "ms", "micros", "nanos"] } } } diff --git a/specification/_json_spec/cat.pending_tasks.json b/specification/_json_spec/cat.pending_tasks.json index 4b1df07146..a2bb597fc9 100644 --- a/specification/_json_spec/cat.pending_tasks.json +++ b/specification/_json_spec/cat.pending_tasks.json @@ -54,6 +54,11 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] } } } diff --git a/specification/_json_spec/cat.plugins.json b/specification/_json_spec/cat.plugins.json index b854e3827b..05ae6a49be 100644 --- a/specification/_json_spec/cat.plugins.json +++ b/specification/_json_spec/cat.plugins.json @@ -54,6 +54,16 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] + }, + "time": { + "type": "enum", + "description": "The unit in which to display time values", + "options": ["d", "h", "m", "s", "ms", "micros", "nanos"] } } } diff --git a/specification/_json_spec/cat.repositories.json b/specification/_json_spec/cat.repositories.json index 351ad25d5c..7a86196778 100644 --- a/specification/_json_spec/cat.repositories.json +++ b/specification/_json_spec/cat.repositories.json @@ -50,6 +50,16 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] + }, + "time": { + "type": "enum", + "description": "The unit in which to display time values", + "options": ["d", "h", "m", "s", "ms", "micros", "nanos"] } } } diff --git a/specification/_json_spec/cat.segments.json b/specification/_json_spec/cat.segments.json index d53ca6e160..b8848a5c0f 100644 --- a/specification/_json_spec/cat.segments.json +++ b/specification/_json_spec/cat.segments.json @@ -64,6 +64,11 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "time": { + "type": "enum", + "description": "The unit in which to display time values", + "options": ["d", "h", "m", "s", "ms", "micros", "nanos"] } } } diff --git a/specification/_json_spec/cat.snapshots.json b/specification/_json_spec/cat.snapshots.json index 1d81a26025..78bad84c22 100644 --- a/specification/_json_spec/cat.snapshots.json +++ b/specification/_json_spec/cat.snapshots.json @@ -65,6 +65,11 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] } } } diff --git a/specification/_json_spec/cat.tasks.json b/specification/_json_spec/cat.tasks.json index 5cd7e43330..94c54e9194 100644 --- a/specification/_json_spec/cat.tasks.json +++ b/specification/_json_spec/cat.tasks.json @@ -71,6 +71,11 @@ "type": "boolean", "default": false, "description": "If `true`, the request blocks until the task has completed." + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] } } } diff --git a/specification/_json_spec/cat.templates.json b/specification/_json_spec/cat.templates.json index a581fe3070..2adf171932 100644 --- a/specification/_json_spec/cat.templates.json +++ b/specification/_json_spec/cat.templates.json @@ -59,6 +59,16 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] + }, + "time": { + "type": "enum", + "description": "The unit in which to display time values", + "options": ["d", "h", "m", "s", "ms", "micros", "nanos"] } } } diff --git a/specification/_json_spec/cat.thread_pool.json b/specification/_json_spec/cat.thread_pool.json index e5cb025867..2ddcccd6a1 100644 --- a/specification/_json_spec/cat.thread_pool.json +++ b/specification/_json_spec/cat.thread_pool.json @@ -64,6 +64,11 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] } } } diff --git a/specification/_json_spec/cat.transforms.json b/specification/_json_spec/cat.transforms.json index ef1f631fae..dba1ce927d 100644 --- a/specification/_json_spec/cat.transforms.json +++ b/specification/_json_spec/cat.transforms.json @@ -67,6 +67,11 @@ "type": "boolean", "description": "Verbose mode. Display column headers", "default": false + }, + "bytes": { + "type": "enum", + "description": "The unit in which to display byte values", + "options": ["b", "kb", "mb", "gb", "tb", "pb"] } } } From 03e01a1f87f48ee2baedaa9d8fdf27fe20044bb7 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 18 Sep 2025 11:15:54 +0400 Subject: [PATCH 24/26] Commit Cargo.lock changes --- compiler-rs/Cargo.lock | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/compiler-rs/Cargo.lock b/compiler-rs/Cargo.lock index 041e723119..1b31d6111b 100644 --- a/compiler-rs/Cargo.lock +++ b/compiler-rs/Cargo.lock @@ -252,6 +252,21 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "clients_schema_to_rest_api_spec" +version = "0.1.0" +dependencies = [ + "anyhow", + "argh", + "clients_schema", + "indexmap", + "itertools", + "serde", + "serde_json", + "tracing", + "tracing-subscriber", +] + [[package]] name = "colorchoice" version = "1.0.3" From 3e8a43b64acd763c7ffbd5d33d5c0aabb2b7c61e Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 18 Sep 2025 11:16:05 +0400 Subject: [PATCH 25/26] Show unexpected union --- compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs index fc4b20bb01..f267765970 100644 --- a/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs +++ b/compiler-rs/clients_schema_to_rest_api_spec/src/lib.rs @@ -260,7 +260,7 @@ fn is_literal(instance: &InstanceOf) -> Option { fn get_type_name(value_of: &ValueOf, types: &IndexMap) -> String { match value_of { ValueOf::ArrayOf(_) => "list".to_string(), - ValueOf::UnionOf(union) => if is_list_enum(union) { "enum" } else { todo!() }.to_string(), + ValueOf::UnionOf(union) => if is_list_enum(union) { "enum" } else { tracing::warn!("{:?}", union); todo!() }.to_string(), ValueOf::LiteralValue(_) => "string".to_string(), ValueOf::InstanceOf(instance) => { let type_name = &instance.typ; From f974687e3e455a99e994f1ba58721703a1fcfd14 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Thu, 18 Sep 2025 15:52:15 +0400 Subject: [PATCH 26/26] Remove '| string' in query parameters --- specification/cat/nodes/CatNodesRequest.ts | 2 +- .../ml/get_overall_buckets/MlGetOverallBucketsRequest.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/specification/cat/nodes/CatNodesRequest.ts b/specification/cat/nodes/CatNodesRequest.ts index 86a1905270..bddb1053a1 100644 --- a/specification/cat/nodes/CatNodesRequest.ts +++ b/specification/cat/nodes/CatNodesRequest.ts @@ -44,7 +44,7 @@ export interface Request extends CatRequestBase { * If `true`, return the full node ID. If `false`, return the shortened node ID. * @server_default false */ - full_id?: boolean | string + full_id?: boolean /** * If true, the response includes information from segments that are not loaded into memory. * @server_default false diff --git a/specification/ml/get_overall_buckets/MlGetOverallBucketsRequest.ts b/specification/ml/get_overall_buckets/MlGetOverallBucketsRequest.ts index 5102e8c841..50bce7a831 100644 --- a/specification/ml/get_overall_buckets/MlGetOverallBucketsRequest.ts +++ b/specification/ml/get_overall_buckets/MlGetOverallBucketsRequest.ts @@ -105,7 +105,7 @@ export interface Request extends RequestBase { * Returns overall buckets with overall scores greater than or equal to this * value. */ - overall_score?: double | string + overall_score?: double /** * Returns overall buckets with timestamps after this time. */ @@ -139,7 +139,7 @@ export interface Request extends RequestBase { /** * Refer to the description for the `overall_score` query parameter. */ - overall_score?: double | string + overall_score?: double /** * Refer to the description for the `start` query parameter. */