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
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Describes an association of a Amazon Web Services Systems Manager document (SSM document) and a managed node.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Association {
/// <p>The name of the SSM document.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The managed node ID.</p>
pub instance_id: ::std::option::Option<::std::string::String>,
/// <p>The ID created by the system when you create an association. An association is a binding between a document and a set of targets with a schedule.</p>
pub association_id: ::std::option::Option<::std::string::String>,
/// <p>The association version.</p>
pub association_version: ::std::option::Option<::std::string::String>,
/// <p>The version of the document used in the association. If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p><important>
/// <p>State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the <code>default</code> version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to <code>default</code>.</p>
/// </important>
pub document_version: ::std::option::Option<::std::string::String>,
/// <p>The managed nodes targeted by the request to create an association. You can target all managed nodes in an Amazon Web Services account by specifying the <code>InstanceIds</code> key with a value of <code>*</code>.</p>
pub targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
/// <p>The date on which the association was last run.</p>
pub last_execution_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>Information about the association.</p>
pub overview: ::std::option::Option<crate::types::AssociationOverview>,
/// <p>A cron expression that specifies a schedule when the association runs. The schedule runs in Coordinated Universal Time (UTC).</p>
pub schedule_expression: ::std::option::Option<::std::string::String>,
/// <p>The association name.</p>
pub association_name: ::std::option::Option<::std::string::String>,
/// <p>Number of days to wait after the scheduled day to run an association.</p>
pub schedule_offset: ::std::option::Option<i32>,
/// <p>The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.</p>
pub duration: ::std::option::Option<i32>,
/// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
pub target_maps:
::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>,
}
impl Association {
/// <p>The name of the SSM document.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The managed node ID.</p>
pub fn instance_id(&self) -> ::std::option::Option<&str> {
self.instance_id.as_deref()
}
/// <p>The ID created by the system when you create an association. An association is a binding between a document and a set of targets with a schedule.</p>
pub fn association_id(&self) -> ::std::option::Option<&str> {
self.association_id.as_deref()
}
/// <p>The association version.</p>
pub fn association_version(&self) -> ::std::option::Option<&str> {
self.association_version.as_deref()
}
/// <p>The version of the document used in the association. If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p><important>
/// <p>State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the <code>default</code> version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to <code>default</code>.</p>
/// </important>
pub fn document_version(&self) -> ::std::option::Option<&str> {
self.document_version.as_deref()
}
/// <p>The managed nodes targeted by the request to create an association. You can target all managed nodes in an Amazon Web Services account by specifying the <code>InstanceIds</code> key with a value of <code>*</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 `.targets.is_none()`.
pub fn targets(&self) -> &[crate::types::Target] {
self.targets.as_deref().unwrap_or_default()
}
/// <p>The date on which the association was last run.</p>
pub fn last_execution_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.last_execution_date.as_ref()
}
/// <p>Information about the association.</p>
pub fn overview(&self) -> ::std::option::Option<&crate::types::AssociationOverview> {
self.overview.as_ref()
}
/// <p>A cron expression that specifies a schedule when the association runs. The schedule runs in Coordinated Universal Time (UTC).</p>
pub fn schedule_expression(&self) -> ::std::option::Option<&str> {
self.schedule_expression.as_deref()
}
/// <p>The association name.</p>
pub fn association_name(&self) -> ::std::option::Option<&str> {
self.association_name.as_deref()
}
/// <p>Number of days to wait after the scheduled day to run an association.</p>
pub fn schedule_offset(&self) -> ::std::option::Option<i32> {
self.schedule_offset
}
/// <p>The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.</p>
pub fn duration(&self) -> ::std::option::Option<i32> {
self.duration
}
/// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</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 `.target_maps.is_none()`.
pub fn target_maps(&self) -> &[::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>] {
self.target_maps.as_deref().unwrap_or_default()
}
}
impl Association {
/// Creates a new builder-style object to manufacture [`Association`](crate::types::Association).
pub fn builder() -> crate::types::builders::AssociationBuilder {
crate::types::builders::AssociationBuilder::default()
}
}
/// A builder for [`Association`](crate::types::Association).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct AssociationBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) instance_id: ::std::option::Option<::std::string::String>,
pub(crate) association_id: ::std::option::Option<::std::string::String>,
pub(crate) association_version: ::std::option::Option<::std::string::String>,
pub(crate) document_version: ::std::option::Option<::std::string::String>,
pub(crate) targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
pub(crate) last_execution_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) overview: ::std::option::Option<crate::types::AssociationOverview>,
pub(crate) schedule_expression: ::std::option::Option<::std::string::String>,
pub(crate) association_name: ::std::option::Option<::std::string::String>,
pub(crate) schedule_offset: ::std::option::Option<i32>,
pub(crate) duration: ::std::option::Option<i32>,
pub(crate) target_maps:
::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>,
}
impl AssociationBuilder {
/// <p>The name of the SSM document.</p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the SSM document.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the SSM document.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The managed node ID.</p>
pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.instance_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The managed node ID.</p>
pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.instance_id = input;
self
}
/// <p>The managed node ID.</p>
pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
&self.instance_id
}
/// <p>The ID created by the system when you create an association. An association is a binding between a document and a set of targets with a schedule.</p>
pub fn association_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.association_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID created by the system when you create an association. An association is a binding between a document and a set of targets with a schedule.</p>
pub fn set_association_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.association_id = input;
self
}
/// <p>The ID created by the system when you create an association. An association is a binding between a document and a set of targets with a schedule.</p>
pub fn get_association_id(&self) -> &::std::option::Option<::std::string::String> {
&self.association_id
}
/// <p>The association version.</p>
pub fn association_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.association_version = ::std::option::Option::Some(input.into());
self
}
/// <p>The association version.</p>
pub fn set_association_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.association_version = input;
self
}
/// <p>The association version.</p>
pub fn get_association_version(&self) -> &::std::option::Option<::std::string::String> {
&self.association_version
}
/// <p>The version of the document used in the association. If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p><important>
/// <p>State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the <code>default</code> version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to <code>default</code>.</p>
/// </important>
pub fn document_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.document_version = ::std::option::Option::Some(input.into());
self
}
/// <p>The version of the document used in the association. If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p><important>
/// <p>State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the <code>default</code> version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to <code>default</code>.</p>
/// </important>
pub fn set_document_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.document_version = input;
self
}
/// <p>The version of the document used in the association. If you change a document version for a State Manager association, Systems Manager immediately runs the association unless you previously specifed the <code>apply-only-at-cron-interval</code> parameter.</p><important>
/// <p>State Manager doesn't support running associations that use a new version of a document if that document is shared from another account. State Manager always runs the <code>default</code> version of a document if shared from another account, even though the Systems Manager console shows that a new version was processed. If you want to run an association using a new version of a document shared form another account, you must set the document version to <code>default</code>.</p>
/// </important>
pub fn get_document_version(&self) -> &::std::option::Option<::std::string::String> {
&self.document_version
}
/// Appends an item to `targets`.
///
/// To override the contents of this collection use [`set_targets`](Self::set_targets).
///
/// <p>The managed nodes targeted by the request to create an association. You can target all managed nodes in an Amazon Web Services account by specifying the <code>InstanceIds</code> key with a value of <code>*</code>.</p>
pub fn targets(mut self, input: crate::types::Target) -> Self {
let mut v = self.targets.unwrap_or_default();
v.push(input);
self.targets = ::std::option::Option::Some(v);
self
}
/// <p>The managed nodes targeted by the request to create an association. You can target all managed nodes in an Amazon Web Services account by specifying the <code>InstanceIds</code> key with a value of <code>*</code>.</p>
pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Target>>) -> Self {
self.targets = input;
self
}
/// <p>The managed nodes targeted by the request to create an association. You can target all managed nodes in an Amazon Web Services account by specifying the <code>InstanceIds</code> key with a value of <code>*</code>.</p>
pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Target>> {
&self.targets
}
/// <p>The date on which the association was last run.</p>
pub fn last_execution_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_execution_date = ::std::option::Option::Some(input);
self
}
/// <p>The date on which the association was last run.</p>
pub fn set_last_execution_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_execution_date = input;
self
}
/// <p>The date on which the association was last run.</p>
pub fn get_last_execution_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_execution_date
}
/// <p>Information about the association.</p>
pub fn overview(mut self, input: crate::types::AssociationOverview) -> Self {
self.overview = ::std::option::Option::Some(input);
self
}
/// <p>Information about the association.</p>
pub fn set_overview(mut self, input: ::std::option::Option<crate::types::AssociationOverview>) -> Self {
self.overview = input;
self
}
/// <p>Information about the association.</p>
pub fn get_overview(&self) -> &::std::option::Option<crate::types::AssociationOverview> {
&self.overview
}
/// <p>A cron expression that specifies a schedule when the association runs. The schedule runs in Coordinated Universal Time (UTC).</p>
pub fn schedule_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.schedule_expression = ::std::option::Option::Some(input.into());
self
}
/// <p>A cron expression that specifies a schedule when the association runs. The schedule runs in Coordinated Universal Time (UTC).</p>
pub fn set_schedule_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.schedule_expression = input;
self
}
/// <p>A cron expression that specifies a schedule when the association runs. The schedule runs in Coordinated Universal Time (UTC).</p>
pub fn get_schedule_expression(&self) -> &::std::option::Option<::std::string::String> {
&self.schedule_expression
}
/// <p>The association name.</p>
pub fn association_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.association_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The association name.</p>
pub fn set_association_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.association_name = input;
self
}
/// <p>The association name.</p>
pub fn get_association_name(&self) -> &::std::option::Option<::std::string::String> {
&self.association_name
}
/// <p>Number of days to wait after the scheduled day to run an association.</p>
pub fn schedule_offset(mut self, input: i32) -> Self {
self.schedule_offset = ::std::option::Option::Some(input);
self
}
/// <p>Number of days to wait after the scheduled day to run an association.</p>
pub fn set_schedule_offset(mut self, input: ::std::option::Option<i32>) -> Self {
self.schedule_offset = input;
self
}
/// <p>Number of days to wait after the scheduled day to run an association.</p>
pub fn get_schedule_offset(&self) -> &::std::option::Option<i32> {
&self.schedule_offset
}
/// <p>The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.</p>
pub fn duration(mut self, input: i32) -> Self {
self.duration = ::std::option::Option::Some(input);
self
}
/// <p>The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.</p>
pub fn set_duration(mut self, input: ::std::option::Option<i32>) -> Self {
self.duration = input;
self
}
/// <p>The number of hours that an association can run on specified targets. After the resulting cutoff time passes, associations that are currently running are cancelled, and no pending executions are started on remaining targets.</p>
pub fn get_duration(&self) -> &::std::option::Option<i32> {
&self.duration
}
/// Appends an item to `target_maps`.
///
/// To override the contents of this collection use [`set_target_maps`](Self::set_target_maps).
///
/// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
pub fn target_maps(mut self, input: ::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>) -> Self {
let mut v = self.target_maps.unwrap_or_default();
v.push(input);
self.target_maps = ::std::option::Option::Some(v);
self
}
/// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
pub fn set_target_maps(
mut self,
input: ::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>>,
) -> Self {
self.target_maps = input;
self
}
/// <p>A key-value mapping of document parameters to target resources. Both Targets and TargetMaps can't be specified together.</p>
pub fn get_target_maps(
&self,
) -> &::std::option::Option<::std::vec::Vec<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>> {
&self.target_maps
}
/// Consumes the builder and constructs a [`Association`](crate::types::Association).
pub fn build(self) -> crate::types::Association {
crate::types::Association {
name: self.name,
instance_id: self.instance_id,
association_id: self.association_id,
association_version: self.association_version,
document_version: self.document_version,
targets: self.targets,
last_execution_date: self.last_execution_date,
overview: self.overview,
schedule_expression: self.schedule_expression,
association_name: self.association_name,
schedule_offset: self.schedule_offset,
duration: self.duration,
target_maps: self.target_maps,
}
}
}