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