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
14
15
16#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
17pub struct CommandAllocatePrimaryAction {
18    #[serde(rename = "index")]
19    pub index: String,
20    #[serde(rename = "node")]
21    pub node: String,  /// 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`.
22    #[serde(rename = "accept_data_loss")]
23    pub accept_data_loss: bool,
24    #[serde(rename = "shard")]
25    pub shard: u32,
26}
27
28impl CommandAllocatePrimaryAction {
29    
30    pub fn new(index: String, node: String, accept_data_loss: bool, shard: u32) -> CommandAllocatePrimaryAction {
31        CommandAllocatePrimaryAction {
32            index,
33            node,
34            accept_data_loss,
35            shard,
36        }
37    }
38}