Skip to main content

opensearch_client/cluster/reroute/
command_allocate_primary_action.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct CommandAllocatePrimaryAction {
15    #[serde(rename = "index")]
16    pub index: String,
17    #[serde(rename = "node")]
18    pub node: String,
19    /// If a node which has a copy of the data rejoins the cluster later on, that data will be deleted. To ensure that these implications are well-understood, this command requires the flag `accept_data_loss` to be explicitly set to `true`.
20    #[serde(rename = "accept_data_loss")]
21    pub accept_data_loss: bool,
22    #[serde(rename = "shard")]
23    pub shard: u32,
24}
25
26impl CommandAllocatePrimaryAction {
27    pub fn new(
28        index: String,
29        node: String,
30        accept_data_loss: bool,
31        shard: u32,
32    ) -> CommandAllocatePrimaryAction {
33        CommandAllocatePrimaryAction {
34            index,
35            node,
36            accept_data_loss,
37            shard,
38        }
39    }
40}