Skip to content

Commit

Permalink
Bump version, update to latest API spec
Browse files Browse the repository at this point in the history
  • Loading branch information
swallez committed Sep 1, 2022
1 parent 1b469ae commit 2d9718b
Show file tree
Hide file tree
Showing 16 changed files with 325 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .ci/run-elasticsearch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ environment=($(cat <<-END
--env ELASTIC_PASSWORD=$elastic_password
--env node.name=$es_node_name
--env cluster.name=$cluster_name
--env cluster.initial_master_nodes=$master_node_name
--env discovery.seed_hosts=$master_node_name
--env cluster.routing.allocation.disk.threshold_enabled=false
--env bootstrap.memory_lock=true
--env node.attr.testattr=test
--env path.repo=/tmp
--env repositories.url.allowed_urls=http://snapshot.test*
--env action.destructive_requires_name=false
--env ingest.geoip.downloader.enabled=false
--env xpack.security.transport.ssl.enabled=false
--env discovery.type=single-node
END
))
if [[ "$TEST_SUITE" == "platinum" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ that is compatible with the version of Elasticsearch you're using

```toml
[dependencies]
elasticsearch = "8.3.3-alpha.1"
elasticsearch = "8.4.0-alpha.1"
```

The following _optional_ dependencies may also be useful to create requests and read responses
Expand Down
2 changes: 1 addition & 1 deletion api_generator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "api_generator"
version = "8.3.3-alpha.1"
version = "8.4.0-alpha.1"
publish = false
description = "Generates source code for elasticsearch package, from the Elasticsearch REST API specs"
repository = "https://github.com/elastic/elasticsearch-rs"
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ compatible with the version of {es} you are using:
[source,toml]
----
[dependencies]
elasticsearch = "8.3.3-alpha.1"
elasticsearch = "8.4.0-alpha.1"
----

The following _optional_ dependencies may also be useful to create requests and
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "elasticsearch"
version = "8.3.3-alpha.1"
version = "8.4.0-alpha.1"
edition = "2018"
authors = ["Elastic and Contributors"]
description = "Official Elasticsearch Rust client"
Expand Down
4 changes: 2 additions & 2 deletions elasticsearch/src/http/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ impl fmt::Display for BuildError {
}
}

/// Default address to Elasticsearch running on `http://localhost:9200`
pub static DEFAULT_ADDRESS: &str = "http://localhost:9200";
/// Default address to Elasticsearch running on `https://localhost:9200`
pub static DEFAULT_ADDRESS: &str = "https://localhost:9200";

lazy_static! {
/// Client metadata header: service, language, transport, followed by additional information
Expand Down
2 changes: 1 addition & 1 deletion elasticsearch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
//!
//! ```toml,no_run
//! [dependencies]
//! elasticsearch = "8.3.3-alpha.1"
//! elasticsearch = "8.4.0-alpha.1"
//! ```
//! The following _optional_ dependencies may also be useful to create requests and read responses
//!
Expand Down
10 changes: 10 additions & 0 deletions elasticsearch/src/ml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9295,6 +9295,7 @@ pub struct MlStartTrainedModelDeployment<'a, 'b, B> {
transport: &'a Transport,
parts: MlStartTrainedModelDeploymentParts<'b>,
body: Option<B>,
cache_size: Option<&'b str>,
error_trace: Option<bool>,
filter_path: Option<&'b [&'b str]>,
headers: HeaderMap,
Expand All @@ -9321,6 +9322,7 @@ where
parts,
headers,
body: None,
cache_size: None,
error_trace: None,
filter_path: None,
human: None,
Expand All @@ -9343,6 +9345,7 @@ where
transport: self.transport,
parts: self.parts,
body: Some(body.into()),
cache_size: self.cache_size,
error_trace: self.error_trace,
filter_path: self.filter_path,
headers: self.headers,
Expand All @@ -9357,6 +9360,11 @@ where
wait_for: self.wait_for,
}
}
#[doc = "A byte-size value for configuring the inference cache size. For example, 20mb."]
pub fn cache_size(mut self, cache_size: &'b str) -> Self {
self.cache_size = Some(cache_size);
self
}
#[doc = "Include the stack trace of returned errors."]
pub fn error_trace(mut self, error_trace: bool) -> Self {
self.error_trace = Some(error_trace);
Expand Down Expand Up @@ -9427,6 +9435,7 @@ where
#[serde_with::skip_serializing_none]
#[derive(Serialize)]
struct QueryParams<'b> {
cache_size: Option<&'b str>,
error_trace: Option<bool>,
#[serde(serialize_with = "crate::client::serialize_coll_qs")]
filter_path: Option<&'b [&'b str]>,
Expand All @@ -9440,6 +9449,7 @@ where
wait_for: Option<&'b str>,
}
let query_params = QueryParams {
cache_size: self.cache_size,
error_trace: self.error_trace,
filter_path: self.filter_path,
human: self.human,
Expand Down
30 changes: 24 additions & 6 deletions elasticsearch/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,15 @@ pub enum OpType {
#[serde(rename = "create")]
Create,
}
#[doc = "If `true` then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` (the default) then do nothing with refreshes."]
#[doc = "Sort order"]
#[derive(Debug, PartialEq, Deserialize, Serialize, Clone, Copy)]
pub enum Order {
#[serde(rename = "asc")]
Asc,
#[serde(rename = "desc")]
Desc,
}
#[doc = "If `true` (the default) then refresh the affected shards to make this operation visible to search, if `wait_for` then wait for a refresh to make this operation visible to search, if `false` then do nothing with refreshes."]
#[derive(Debug, PartialEq, Deserialize, Serialize, Clone, Copy)]
pub enum Refresh {
#[serde(rename = "true")]
Expand All @@ -173,13 +181,23 @@ pub enum SearchType {
#[serde(rename = "dfs_query_then_fetch")]
DfsQueryThenFetch,
}
#[doc = "The sort order for 'cpu' type (default: total)"]
#[doc = "Allows setting a sort order for the result. Defaults to start_time"]
#[derive(Debug, PartialEq, Deserialize, Serialize, Clone, Copy)]
pub enum Sort {
#[serde(rename = "cpu")]
Cpu,
#[serde(rename = "total")]
Total,
#[serde(rename = "start_time")]
StartTime,
#[serde(rename = "duration")]
Duration,
#[serde(rename = "name")]
Name,
#[serde(rename = "repository")]
Repository,
#[serde(rename = "index_count")]
IndexCount,
#[serde(rename = "shard_count")]
ShardCount,
#[serde(rename = "failed_shard_count")]
FailedShardCount,
}
#[doc = "Specify suggest mode"]
#[derive(Debug, PartialEq, Deserialize, Serialize, Clone, Copy)]
Expand Down
29 changes: 29 additions & 0 deletions elasticsearch/src/root/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2951,6 +2951,7 @@ pub struct Get<'a, 'b> {
_source_includes: Option<&'b [&'b str]>,
error_trace: Option<bool>,
filter_path: Option<&'b [&'b str]>,
force_synthetic_source: Option<bool>,
headers: HeaderMap,
human: Option<bool>,
preference: Option<&'b str>,
Expand All @@ -2977,6 +2978,7 @@ impl<'a, 'b> Get<'a, 'b> {
_source_includes: None,
error_trace: None,
filter_path: None,
force_synthetic_source: None,
human: None,
preference: None,
pretty: None,
Expand Down Expand Up @@ -3015,6 +3017,11 @@ impl<'a, 'b> Get<'a, 'b> {
self.filter_path = Some(filter_path);
self
}
#[doc = "Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index."]
pub fn force_synthetic_source(mut self, force_synthetic_source: bool) -> Self {
self.force_synthetic_source = Some(force_synthetic_source);
self
}
#[doc = "Adds a HTTP header"]
pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
self.headers.insert(key, value);
Expand Down Expand Up @@ -3094,6 +3101,7 @@ impl<'a, 'b> Get<'a, 'b> {
error_trace: Option<bool>,
#[serde(serialize_with = "crate::client::serialize_coll_qs")]
filter_path: Option<&'b [&'b str]>,
force_synthetic_source: Option<bool>,
human: Option<bool>,
preference: Option<&'b str>,
pretty: Option<bool>,
Expand All @@ -3112,6 +3120,7 @@ impl<'a, 'b> Get<'a, 'b> {
_source_includes: self._source_includes,
error_trace: self.error_trace,
filter_path: self.filter_path,
force_synthetic_source: self.force_synthetic_source,
human: self.human,
preference: self.preference,
pretty: self.pretty,
Expand Down Expand Up @@ -4267,6 +4276,7 @@ pub struct Mget<'a, 'b, B> {
body: Option<B>,
error_trace: Option<bool>,
filter_path: Option<&'b [&'b str]>,
force_synthetic_source: Option<bool>,
headers: HeaderMap,
human: Option<bool>,
preference: Option<&'b str>,
Expand Down Expand Up @@ -4295,6 +4305,7 @@ where
body: None,
error_trace: None,
filter_path: None,
force_synthetic_source: None,
human: None,
preference: None,
pretty: None,
Expand Down Expand Up @@ -4335,6 +4346,7 @@ where
_source_includes: self._source_includes,
error_trace: self.error_trace,
filter_path: self.filter_path,
force_synthetic_source: self.force_synthetic_source,
headers: self.headers,
human: self.human,
preference: self.preference,
Expand All @@ -4357,6 +4369,11 @@ where
self.filter_path = Some(filter_path);
self
}
#[doc = "Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index."]
pub fn force_synthetic_source(mut self, force_synthetic_source: bool) -> Self {
self.force_synthetic_source = Some(force_synthetic_source);
self
}
#[doc = "Adds a HTTP header"]
pub fn header(mut self, key: HeaderName, value: HeaderValue) -> Self {
self.headers.insert(key, value);
Expand Down Expand Up @@ -4429,6 +4446,7 @@ where
error_trace: Option<bool>,
#[serde(serialize_with = "crate::client::serialize_coll_qs")]
filter_path: Option<&'b [&'b str]>,
force_synthetic_source: Option<bool>,
human: Option<bool>,
preference: Option<&'b str>,
pretty: Option<bool>,
Expand All @@ -4445,6 +4463,7 @@ where
_source_includes: self._source_includes,
error_trace: self.error_trace,
filter_path: self.filter_path,
force_synthetic_source: self.force_synthetic_source,
human: self.human,
preference: self.preference,
pretty: self.pretty,
Expand Down Expand Up @@ -6722,6 +6741,7 @@ pub struct Search<'a, 'b, B> {
expand_wildcards: Option<&'b [ExpandWildcards]>,
explain: Option<bool>,
filter_path: Option<&'b [&'b str]>,
force_synthetic_source: Option<bool>,
from: Option<i64>,
headers: HeaderMap,
human: Option<bool>,
Expand Down Expand Up @@ -6785,6 +6805,7 @@ where
expand_wildcards: None,
explain: None,
filter_path: None,
force_synthetic_source: None,
from: None,
human: None,
ignore_throttled: None,
Expand Down Expand Up @@ -6885,6 +6906,7 @@ where
expand_wildcards: self.expand_wildcards,
explain: self.explain,
filter_path: self.filter_path,
force_synthetic_source: self.force_synthetic_source,
from: self.from,
headers: self.headers,
human: self.human,
Expand Down Expand Up @@ -6961,6 +6983,11 @@ where
self.filter_path = Some(filter_path);
self
}
#[doc = "Should this request force synthetic _source? Use this to test if the mapping supports synthetic _source and to get a sense of the worst case performance. Fetches with this enabled will be slower the enabling synthetic source natively in the index."]
pub fn force_synthetic_source(mut self, force_synthetic_source: bool) -> Self {
self.force_synthetic_source = Some(force_synthetic_source);
self
}
#[doc = "Starting offset (default: 0)"]
pub fn from(mut self, from: i64) -> Self {
self.from = Some(from);
Expand Down Expand Up @@ -7166,6 +7193,7 @@ where
explain: Option<bool>,
#[serde(serialize_with = "crate::client::serialize_coll_qs")]
filter_path: Option<&'b [&'b str]>,
force_synthetic_source: Option<bool>,
from: Option<i64>,
human: Option<bool>,
ignore_throttled: Option<bool>,
Expand Down Expand Up @@ -7220,6 +7248,7 @@ where
expand_wildcards: self.expand_wildcards,
explain: self.explain,
filter_path: self.filter_path,
force_synthetic_source: self.force_synthetic_source,
from: self.from,
human: self.human,
ignore_throttled: self.ignore_throttled,
Expand Down
Loading

0 comments on commit 2d9718b

Please sign in to comment.