opensearch_client/cluster/allocation_explain_request_body_json.rs
1/*
2 * opensearch-client
3 *
4 * Rust Client for OpenSearch
5 *
6 * The version of the OpenAPI document: 3.1.0
7 * Contact: alberto.paro@gmail.com
8 * Generated by Paro OpenAPI Generator
9 */
10
11use serde::{Deserialize, Serialize};
12
13/// AllocationExplainRequestBodyJson
14/// The index, shard, and primary flag for which to generate an explanation. Leave this empty to generate an explanation for the first unassigned shard.
15
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct AllocationExplainRequestBodyJson {
18 /// When `true`, returns a routing explanation for the primary shard based on the node ID.
19 #[serde(rename = "primary", default, skip_serializing_if = "Option::is_none")]
20 pub primary: Option<bool>,
21 /// Specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node.
22 #[serde(
23 rename = "current_node",
24 default,
25 skip_serializing_if = "Option::is_none"
26 )]
27 pub current_node: Option<String>,
28 /// Specifies the ID of the shard that you would like an explanation for.
29 #[serde(rename = "shard", default, skip_serializing_if = "Option::is_none")]
30 pub shard: Option<u32>,
31 #[serde(rename = "index", default, skip_serializing_if = "Option::is_none")]
32 pub index: Option<String>,
33}
34
35impl AllocationExplainRequestBodyJson {
36 /// The index, shard, and primary flag for which to generate an explanation. Leave this empty to generate an explanation for the first unassigned shard.
37 pub fn new() -> AllocationExplainRequestBodyJson {
38 AllocationExplainRequestBodyJson {
39 primary: None,
40 current_node: None,
41 shard: None,
42 index: None,
43 }
44 }
45}