1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct StartCapacityTaskInput {
/// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
pub outpost_identifier: ::std::option::Option<::std::string::String>,
/// <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
pub order_id: ::std::option::Option<::std::string::String>,
/// <p>The ID of the Outpost asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
pub asset_id: ::std::option::Option<::std::string::String>,
/// <p>The instance pools specified in the capacity task.</p>
pub instance_pools: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>,
/// <p>List of user-specified running instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
pub instances_to_exclude: ::std::option::Option<crate::types::InstancesToExclude>,
/// <p>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
pub dry_run: ::std::option::Option<bool>,
/// <p>Specify one of the following options in case an instance is blocking the capacity task from running.</p>
/// <ul>
/// <li>
/// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
/// <li>
/// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
/// </ul>
pub task_action_on_blocking_instances: ::std::option::Option<crate::types::TaskActionOnBlockingInstances>,
}
impl StartCapacityTaskInput {
/// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
pub fn outpost_identifier(&self) -> ::std::option::Option<&str> {
self.outpost_identifier.as_deref()
}
/// <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
pub fn order_id(&self) -> ::std::option::Option<&str> {
self.order_id.as_deref()
}
/// <p>The ID of the Outpost asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
pub fn asset_id(&self) -> ::std::option::Option<&str> {
self.asset_id.as_deref()
}
/// <p>The instance pools specified in the capacity task.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.instance_pools.is_none()`.
pub fn instance_pools(&self) -> &[crate::types::InstanceTypeCapacity] {
self.instance_pools.as_deref().unwrap_or_default()
}
/// <p>List of user-specified running instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
pub fn instances_to_exclude(&self) -> ::std::option::Option<&crate::types::InstancesToExclude> {
self.instances_to_exclude.as_ref()
}
/// <p>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
pub fn dry_run(&self) -> ::std::option::Option<bool> {
self.dry_run
}
/// <p>Specify one of the following options in case an instance is blocking the capacity task from running.</p>
/// <ul>
/// <li>
/// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
/// <li>
/// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
/// </ul>
pub fn task_action_on_blocking_instances(&self) -> ::std::option::Option<&crate::types::TaskActionOnBlockingInstances> {
self.task_action_on_blocking_instances.as_ref()
}
}
impl StartCapacityTaskInput {
/// Creates a new builder-style object to manufacture [`StartCapacityTaskInput`](crate::operation::start_capacity_task::StartCapacityTaskInput).
pub fn builder() -> crate::operation::start_capacity_task::builders::StartCapacityTaskInputBuilder {
crate::operation::start_capacity_task::builders::StartCapacityTaskInputBuilder::default()
}
}
/// A builder for [`StartCapacityTaskInput`](crate::operation::start_capacity_task::StartCapacityTaskInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartCapacityTaskInputBuilder {
pub(crate) outpost_identifier: ::std::option::Option<::std::string::String>,
pub(crate) order_id: ::std::option::Option<::std::string::String>,
pub(crate) asset_id: ::std::option::Option<::std::string::String>,
pub(crate) instance_pools: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>,
pub(crate) instances_to_exclude: ::std::option::Option<crate::types::InstancesToExclude>,
pub(crate) dry_run: ::std::option::Option<bool>,
pub(crate) task_action_on_blocking_instances: ::std::option::Option<crate::types::TaskActionOnBlockingInstances>,
}
impl StartCapacityTaskInputBuilder {
/// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
/// This field is required.
pub fn outpost_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.outpost_identifier = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
pub fn set_outpost_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.outpost_identifier = input;
self
}
/// <p>The ID or ARN of the Outposts associated with the specified capacity task.</p>
pub fn get_outpost_identifier(&self) -> &::std::option::Option<::std::string::String> {
&self.outpost_identifier
}
/// <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
pub fn order_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.order_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
pub fn set_order_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.order_id = input;
self
}
/// <p>The ID of the Amazon Web Services Outposts order associated with the specified capacity task.</p>
pub fn get_order_id(&self) -> &::std::option::Option<::std::string::String> {
&self.order_id
}
/// <p>The ID of the Outpost asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.asset_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the Outpost asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.asset_id = input;
self
}
/// <p>The ID of the Outpost asset. An Outpost asset can be a single server within an Outposts rack or an Outposts server configuration.</p>
pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
&self.asset_id
}
/// Appends an item to `instance_pools`.
///
/// To override the contents of this collection use [`set_instance_pools`](Self::set_instance_pools).
///
/// <p>The instance pools specified in the capacity task.</p>
pub fn instance_pools(mut self, input: crate::types::InstanceTypeCapacity) -> Self {
let mut v = self.instance_pools.unwrap_or_default();
v.push(input);
self.instance_pools = ::std::option::Option::Some(v);
self
}
/// <p>The instance pools specified in the capacity task.</p>
pub fn set_instance_pools(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>>) -> Self {
self.instance_pools = input;
self
}
/// <p>The instance pools specified in the capacity task.</p>
pub fn get_instance_pools(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceTypeCapacity>> {
&self.instance_pools
}
/// <p>List of user-specified running instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
pub fn instances_to_exclude(mut self, input: crate::types::InstancesToExclude) -> Self {
self.instances_to_exclude = ::std::option::Option::Some(input);
self
}
/// <p>List of user-specified running instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
pub fn set_instances_to_exclude(mut self, input: ::std::option::Option<crate::types::InstancesToExclude>) -> Self {
self.instances_to_exclude = input;
self
}
/// <p>List of user-specified running instances that must not be stopped in order to free up the capacity needed to run the capacity task.</p>
pub fn get_instances_to_exclude(&self) -> &::std::option::Option<crate::types::InstancesToExclude> {
&self.instances_to_exclude
}
/// <p>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = ::std::option::Option::Some(input);
self
}
/// <p>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
/// <p>You can request a dry run to determine if the instance type and instance size changes is above or below available instance capacity. Requesting a dry run does not make any changes to your plan.</p>
pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
&self.dry_run
}
/// <p>Specify one of the following options in case an instance is blocking the capacity task from running.</p>
/// <ul>
/// <li>
/// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
/// <li>
/// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
/// </ul>
pub fn task_action_on_blocking_instances(mut self, input: crate::types::TaskActionOnBlockingInstances) -> Self {
self.task_action_on_blocking_instances = ::std::option::Option::Some(input);
self
}
/// <p>Specify one of the following options in case an instance is blocking the capacity task from running.</p>
/// <ul>
/// <li>
/// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
/// <li>
/// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
/// </ul>
pub fn set_task_action_on_blocking_instances(mut self, input: ::std::option::Option<crate::types::TaskActionOnBlockingInstances>) -> Self {
self.task_action_on_blocking_instances = input;
self
}
/// <p>Specify one of the following options in case an instance is blocking the capacity task from running.</p>
/// <ul>
/// <li>
/// <p><code>WAIT_FOR_EVACUATION</code> - Checks every 10 minutes over 48 hours to determine if instances have stopped and capacity is available to complete the task.</p></li>
/// <li>
/// <p><code>FAIL_TASK</code> - The capacity task fails.</p></li>
/// </ul>
pub fn get_task_action_on_blocking_instances(&self) -> &::std::option::Option<crate::types::TaskActionOnBlockingInstances> {
&self.task_action_on_blocking_instances
}
/// Consumes the builder and constructs a [`StartCapacityTaskInput`](crate::operation::start_capacity_task::StartCapacityTaskInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::start_capacity_task::StartCapacityTaskInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::start_capacity_task::StartCapacityTaskInput {
outpost_identifier: self.outpost_identifier,
order_id: self.order_id,
asset_id: self.asset_id,
instance_pools: self.instance_pools,
instances_to_exclude: self.instances_to_exclude,
dry_run: self.dry_run,
task_action_on_blocking_instances: self.task_action_on_blocking_instances,
})
}
}