Skip to main content

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
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct AllocationExplainRequestBodyJson {  /// 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>,  /// Specifies the node ID or the name of the node to only explain a shard that is currently located on the specified node.
21    #[serde(rename = "current_node", default, skip_serializing_if = "Option::is_none")]
22    pub current_node: Option<String>,  /// Specifies the ID of the shard that you would like an explanation for.
23    #[serde(rename = "shard", default, skip_serializing_if = "Option::is_none")]
24    pub shard: Option<u32>,
25    #[serde(rename = "index", default, skip_serializing_if = "Option::is_none")]
26    pub index: Option<String>,
27}
28
29impl AllocationExplainRequestBodyJson {
30      /// The index, shard, and primary flag for which to generate an explanation. Leave this empty to generate an explanation for the first unassigned shard.
31    pub fn new() -> AllocationExplainRequestBodyJson {
32        AllocationExplainRequestBodyJson {
33            primary: None,
34            current_node: None,
35            shard: None,
36            index: None,
37        }
38    }
39}