opensearch_client/cluster/reroute/
command_allocate_primary_action.rs1use 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 #[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}