opensearch_client/cluster/reroute/
command_cancel_action.rs1use serde::{Deserialize, Serialize};
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct CommandCancelAction {
15 #[serde(rename = "index")]
16 pub index: String,
17 #[serde(rename = "node")]
18 pub node: String,
19 #[serde(rename = "shard")]
20 pub shard: u32,
21 #[serde(
22 rename = "allow_primary",
23 default,
24 skip_serializing_if = "Option::is_none"
25 )]
26 pub allow_primary: Option<bool>,
27}
28
29impl CommandCancelAction {
30 pub fn new(index: String, node: String, shard: u32) -> CommandCancelAction {
31 CommandCancelAction {
32 index,
33 node,
34 shard,
35 allow_primary: None,
36 }
37 }
38}