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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
// 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 CreateInstancesInput {
/// <p>The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for example: <code>\["MyFirstInstance","MySecondInstance"\]</code></p>
pub instance_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The Availability Zone in which to create your instance. Use the following format: <code>us-east-2a</code> (case sensitive). You can get a list of Availability Zones by using the <a href="http://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetRegions.html">get regions</a> operation. Be sure to add the <code>include Availability Zones</code> parameter to your request.</p>
pub availability_zone: ::std::option::Option<::std::string::String>,
/// <p>(Discontinued) The name for your custom image.</p><note>
/// <p>In releases prior to June 12, 2017, this parameter was ignored by the API. It is now discontinued.</p>
/// </note>
#[deprecated]
pub custom_image_name: ::std::option::Option<::std::string::String>,
/// <p>The ID for a virtual private server image (<code>app_wordpress_x_x</code> or <code>app_lamp_x_x</code>). Use the <code>get blueprints</code> operation to return a list of available images (or <i>blueprints</i>).</p><note>
/// <p>Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when they become outdated due to operating system updates or new application releases.</p>
/// </note>
pub blueprint_id: ::std::option::Option<::std::string::String>,
/// <p>The bundle of specification information for your virtual private server (or <i>instance</i>), including the pricing plan (<code>medium_x_x</code>).</p>
pub bundle_id: ::std::option::Option<::std::string::String>,
/// <p>A launch script you can create that configures a server with additional user data. For example, you might want to run <code>apt-get -y update</code>.</p><note>
/// <p>Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and CentOS use <code>yum</code>, Debian and Ubuntu use <code>apt-get</code>, and FreeBSD uses <code>pkg</code>. For a complete list, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/compare-options-choose-lightsail-instance-image">Amazon Lightsail Developer Guide</a>.</p>
/// </note>
pub user_data: ::std::option::Option<::std::string::String>,
/// <p>The name of your key pair.</p>
pub key_pair_name: ::std::option::Option<::std::string::String>,
/// <p>The tag keys and optional values to add to the resource during create.</p>
/// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
/// <p>An array of objects representing the add-ons to enable for the new instance.</p>
pub add_ons: ::std::option::Option<::std::vec::Vec<crate::types::AddOnRequest>>,
/// <p>The IP address type for the instance.</p>
/// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
/// <p>The default value is <code>dualstack</code>.</p>
pub ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
}
impl CreateInstancesInput {
/// <p>The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for example: <code>\["MyFirstInstance","MySecondInstance"\]</code></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_names.is_none()`.
pub fn instance_names(&self) -> &[::std::string::String] {
self.instance_names.as_deref().unwrap_or_default()
}
/// <p>The Availability Zone in which to create your instance. Use the following format: <code>us-east-2a</code> (case sensitive). You can get a list of Availability Zones by using the <a href="http://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetRegions.html">get regions</a> operation. Be sure to add the <code>include Availability Zones</code> parameter to your request.</p>
pub fn availability_zone(&self) -> ::std::option::Option<&str> {
self.availability_zone.as_deref()
}
/// <p>(Discontinued) The name for your custom image.</p><note>
/// <p>In releases prior to June 12, 2017, this parameter was ignored by the API. It is now discontinued.</p>
/// </note>
#[deprecated]
pub fn custom_image_name(&self) -> ::std::option::Option<&str> {
self.custom_image_name.as_deref()
}
/// <p>The ID for a virtual private server image (<code>app_wordpress_x_x</code> or <code>app_lamp_x_x</code>). Use the <code>get blueprints</code> operation to return a list of available images (or <i>blueprints</i>).</p><note>
/// <p>Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when they become outdated due to operating system updates or new application releases.</p>
/// </note>
pub fn blueprint_id(&self) -> ::std::option::Option<&str> {
self.blueprint_id.as_deref()
}
/// <p>The bundle of specification information for your virtual private server (or <i>instance</i>), including the pricing plan (<code>medium_x_x</code>).</p>
pub fn bundle_id(&self) -> ::std::option::Option<&str> {
self.bundle_id.as_deref()
}
/// <p>A launch script you can create that configures a server with additional user data. For example, you might want to run <code>apt-get -y update</code>.</p><note>
/// <p>Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and CentOS use <code>yum</code>, Debian and Ubuntu use <code>apt-get</code>, and FreeBSD uses <code>pkg</code>. For a complete list, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/compare-options-choose-lightsail-instance-image">Amazon Lightsail Developer Guide</a>.</p>
/// </note>
pub fn user_data(&self) -> ::std::option::Option<&str> {
self.user_data.as_deref()
}
/// <p>The name of your key pair.</p>
pub fn key_pair_name(&self) -> ::std::option::Option<&str> {
self.key_pair_name.as_deref()
}
/// <p>The tag keys and optional values to add to the resource during create.</p>
/// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</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 `.tags.is_none()`.
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
/// <p>An array of objects representing the add-ons to enable for the new instance.</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 `.add_ons.is_none()`.
pub fn add_ons(&self) -> &[crate::types::AddOnRequest] {
self.add_ons.as_deref().unwrap_or_default()
}
/// <p>The IP address type for the instance.</p>
/// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
/// <p>The default value is <code>dualstack</code>.</p>
pub fn ip_address_type(&self) -> ::std::option::Option<&crate::types::IpAddressType> {
self.ip_address_type.as_ref()
}
}
impl CreateInstancesInput {
/// Creates a new builder-style object to manufacture [`CreateInstancesInput`](crate::operation::create_instances::CreateInstancesInput).
pub fn builder() -> crate::operation::create_instances::builders::CreateInstancesInputBuilder {
crate::operation::create_instances::builders::CreateInstancesInputBuilder::default()
}
}
/// A builder for [`CreateInstancesInput`](crate::operation::create_instances::CreateInstancesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateInstancesInputBuilder {
pub(crate) instance_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) availability_zone: ::std::option::Option<::std::string::String>,
pub(crate) custom_image_name: ::std::option::Option<::std::string::String>,
pub(crate) blueprint_id: ::std::option::Option<::std::string::String>,
pub(crate) bundle_id: ::std::option::Option<::std::string::String>,
pub(crate) user_data: ::std::option::Option<::std::string::String>,
pub(crate) key_pair_name: ::std::option::Option<::std::string::String>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub(crate) add_ons: ::std::option::Option<::std::vec::Vec<crate::types::AddOnRequest>>,
pub(crate) ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
}
impl CreateInstancesInputBuilder {
/// Appends an item to `instance_names`.
///
/// To override the contents of this collection use [`set_instance_names`](Self::set_instance_names).
///
/// <p>The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for example: <code>\["MyFirstInstance","MySecondInstance"\]</code></p>
pub fn instance_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.instance_names.unwrap_or_default();
v.push(input.into());
self.instance_names = ::std::option::Option::Some(v);
self
}
/// <p>The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for example: <code>\["MyFirstInstance","MySecondInstance"\]</code></p>
pub fn set_instance_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.instance_names = input;
self
}
/// <p>The names to use for your new Lightsail instances. Separate multiple values using quotation marks and commas, for example: <code>\["MyFirstInstance","MySecondInstance"\]</code></p>
pub fn get_instance_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.instance_names
}
/// <p>The Availability Zone in which to create your instance. Use the following format: <code>us-east-2a</code> (case sensitive). You can get a list of Availability Zones by using the <a href="http://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetRegions.html">get regions</a> operation. Be sure to add the <code>include Availability Zones</code> parameter to your request.</p>
/// This field is required.
pub fn availability_zone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.availability_zone = ::std::option::Option::Some(input.into());
self
}
/// <p>The Availability Zone in which to create your instance. Use the following format: <code>us-east-2a</code> (case sensitive). You can get a list of Availability Zones by using the <a href="http://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetRegions.html">get regions</a> operation. Be sure to add the <code>include Availability Zones</code> parameter to your request.</p>
pub fn set_availability_zone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.availability_zone = input;
self
}
/// <p>The Availability Zone in which to create your instance. Use the following format: <code>us-east-2a</code> (case sensitive). You can get a list of Availability Zones by using the <a href="http://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_GetRegions.html">get regions</a> operation. Be sure to add the <code>include Availability Zones</code> parameter to your request.</p>
pub fn get_availability_zone(&self) -> &::std::option::Option<::std::string::String> {
&self.availability_zone
}
/// <p>(Discontinued) The name for your custom image.</p><note>
/// <p>In releases prior to June 12, 2017, this parameter was ignored by the API. It is now discontinued.</p>
/// </note>
#[deprecated]
pub fn custom_image_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.custom_image_name = ::std::option::Option::Some(input.into());
self
}
/// <p>(Discontinued) The name for your custom image.</p><note>
/// <p>In releases prior to June 12, 2017, this parameter was ignored by the API. It is now discontinued.</p>
/// </note>
#[deprecated]
pub fn set_custom_image_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.custom_image_name = input;
self
}
/// <p>(Discontinued) The name for your custom image.</p><note>
/// <p>In releases prior to June 12, 2017, this parameter was ignored by the API. It is now discontinued.</p>
/// </note>
#[deprecated]
pub fn get_custom_image_name(&self) -> &::std::option::Option<::std::string::String> {
&self.custom_image_name
}
/// <p>The ID for a virtual private server image (<code>app_wordpress_x_x</code> or <code>app_lamp_x_x</code>). Use the <code>get blueprints</code> operation to return a list of available images (or <i>blueprints</i>).</p><note>
/// <p>Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when they become outdated due to operating system updates or new application releases.</p>
/// </note>
/// This field is required.
pub fn blueprint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.blueprint_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID for a virtual private server image (<code>app_wordpress_x_x</code> or <code>app_lamp_x_x</code>). Use the <code>get blueprints</code> operation to return a list of available images (or <i>blueprints</i>).</p><note>
/// <p>Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when they become outdated due to operating system updates or new application releases.</p>
/// </note>
pub fn set_blueprint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.blueprint_id = input;
self
}
/// <p>The ID for a virtual private server image (<code>app_wordpress_x_x</code> or <code>app_lamp_x_x</code>). Use the <code>get blueprints</code> operation to return a list of available images (or <i>blueprints</i>).</p><note>
/// <p>Use active blueprints when creating new instances. Inactive blueprints are listed to support customers with existing instances and are not necessarily available to create new instances. Blueprints are marked inactive when they become outdated due to operating system updates or new application releases.</p>
/// </note>
pub fn get_blueprint_id(&self) -> &::std::option::Option<::std::string::String> {
&self.blueprint_id
}
/// <p>The bundle of specification information for your virtual private server (or <i>instance</i>), including the pricing plan (<code>medium_x_x</code>).</p>
/// This field is required.
pub fn bundle_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.bundle_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The bundle of specification information for your virtual private server (or <i>instance</i>), including the pricing plan (<code>medium_x_x</code>).</p>
pub fn set_bundle_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.bundle_id = input;
self
}
/// <p>The bundle of specification information for your virtual private server (or <i>instance</i>), including the pricing plan (<code>medium_x_x</code>).</p>
pub fn get_bundle_id(&self) -> &::std::option::Option<::std::string::String> {
&self.bundle_id
}
/// <p>A launch script you can create that configures a server with additional user data. For example, you might want to run <code>apt-get -y update</code>.</p><note>
/// <p>Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and CentOS use <code>yum</code>, Debian and Ubuntu use <code>apt-get</code>, and FreeBSD uses <code>pkg</code>. For a complete list, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/compare-options-choose-lightsail-instance-image">Amazon Lightsail Developer Guide</a>.</p>
/// </note>
pub fn user_data(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.user_data = ::std::option::Option::Some(input.into());
self
}
/// <p>A launch script you can create that configures a server with additional user data. For example, you might want to run <code>apt-get -y update</code>.</p><note>
/// <p>Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and CentOS use <code>yum</code>, Debian and Ubuntu use <code>apt-get</code>, and FreeBSD uses <code>pkg</code>. For a complete list, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/compare-options-choose-lightsail-instance-image">Amazon Lightsail Developer Guide</a>.</p>
/// </note>
pub fn set_user_data(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.user_data = input;
self
}
/// <p>A launch script you can create that configures a server with additional user data. For example, you might want to run <code>apt-get -y update</code>.</p><note>
/// <p>Depending on the machine image you choose, the command to get software on your instance varies. Amazon Linux and CentOS use <code>yum</code>, Debian and Ubuntu use <code>apt-get</code>, and FreeBSD uses <code>pkg</code>. For a complete list, see the <a href="https://docs.aws.amazon.com/lightsail/latest/userguide/compare-options-choose-lightsail-instance-image">Amazon Lightsail Developer Guide</a>.</p>
/// </note>
pub fn get_user_data(&self) -> &::std::option::Option<::std::string::String> {
&self.user_data
}
/// <p>The name of your key pair.</p>
pub fn key_pair_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.key_pair_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of your key pair.</p>
pub fn set_key_pair_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.key_pair_name = input;
self
}
/// <p>The name of your key pair.</p>
pub fn get_key_pair_name(&self) -> &::std::option::Option<::std::string::String> {
&self.key_pair_name
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>The tag keys and optional values to add to the resource during create.</p>
/// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>The tag keys and optional values to add to the resource during create.</p>
/// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>The tag keys and optional values to add to the resource during create.</p>
/// <p>Use the <code>TagResource</code> action to tag a resource after it's created.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
/// Appends an item to `add_ons`.
///
/// To override the contents of this collection use [`set_add_ons`](Self::set_add_ons).
///
/// <p>An array of objects representing the add-ons to enable for the new instance.</p>
pub fn add_ons(mut self, input: crate::types::AddOnRequest) -> Self {
let mut v = self.add_ons.unwrap_or_default();
v.push(input);
self.add_ons = ::std::option::Option::Some(v);
self
}
/// <p>An array of objects representing the add-ons to enable for the new instance.</p>
pub fn set_add_ons(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AddOnRequest>>) -> Self {
self.add_ons = input;
self
}
/// <p>An array of objects representing the add-ons to enable for the new instance.</p>
pub fn get_add_ons(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AddOnRequest>> {
&self.add_ons
}
/// <p>The IP address type for the instance.</p>
/// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
/// <p>The default value is <code>dualstack</code>.</p>
pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
self.ip_address_type = ::std::option::Option::Some(input);
self
}
/// <p>The IP address type for the instance.</p>
/// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
/// <p>The default value is <code>dualstack</code>.</p>
pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
self.ip_address_type = input;
self
}
/// <p>The IP address type for the instance.</p>
/// <p>The possible values are <code>ipv4</code> for IPv4 only, <code>ipv6</code> for IPv6 only, and <code>dualstack</code> for IPv4 and IPv6.</p>
/// <p>The default value is <code>dualstack</code>.</p>
pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
&self.ip_address_type
}
/// Consumes the builder and constructs a [`CreateInstancesInput`](crate::operation::create_instances::CreateInstancesInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_instances::CreateInstancesInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_instances::CreateInstancesInput {
instance_names: self.instance_names,
availability_zone: self.availability_zone,
custom_image_name: self.custom_image_name,
blueprint_id: self.blueprint_id,
bundle_id: self.bundle_id,
user_data: self.user_data,
key_pair_name: self.key_pair_name,
tags: self.tags,
add_ons: self.add_ons,
ip_address_type: self.ip_address_type,
})
}
}