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
// 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 DiscoverInstancesInput {
/// <p>The <code>HttpName</code> name of the namespace. The <code>HttpName</code> is found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace. In most cases, <code>Name</code> and <code>HttpName</code> match. However, if you reuse <code>Name</code> for namespace creation, a generated hash is added to <code>HttpName</code> to distinguish the two.</p>
pub namespace_name: ::std::option::Option<::std::string::String>,
/// <p>The name of the service that you specified when you registered the instance.</p>
pub service_name: ::std::option::Option<::std::string::String>,
/// <p>The maximum number of instances that you want Cloud Map to return in the response to a <code>DiscoverInstances</code> request. If you don't specify a value for <code>MaxResults</code>, Cloud Map returns up to 100 instances.</p>
pub max_results: ::std::option::Option<i32>,
/// <p>Filters to scope the results based on custom attributes for the instance (for example, <code>{version=v1, az=1a}</code>). Only instances that match all the specified key-value pairs are returned.</p>
pub query_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// <p>Opportunistic filters to scope the results based on custom attributes. If there are instances that match both the filters specified in both the <code>QueryParameters</code> parameter and this parameter, all of these instances are returned. Otherwise, the filters are ignored, and only instances that match the filters that are specified in the <code>QueryParameters</code> parameter are returned.</p>
pub optional_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
/// <p>The health status of the instances that you want to discover. This parameter is ignored for services that don't have a health check configured, and all instances are returned.</p>
/// <dl>
/// <dt>
/// HEALTHY
/// </dt>
/// <dd>
/// <p>Returns healthy instances.</p>
/// </dd>
/// <dt>
/// UNHEALTHY
/// </dt>
/// <dd>
/// <p>Returns unhealthy instances.</p>
/// </dd>
/// <dt>
/// ALL
/// </dt>
/// <dd>
/// <p>Returns all instances.</p>
/// </dd>
/// <dt>
/// HEALTHY_OR_ELSE_ALL
/// </dt>
/// <dd>
/// <p>Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. This is also called failing open.</p>
/// </dd>
/// </dl>
pub health_status: ::std::option::Option<crate::types::HealthStatusFilter>,
/// <p>The ID of the Amazon Web Services account that owns the namespace associated with the instance, as specified in the namespace <code>ResourceOwner</code> field. For instances associated with namespaces that are shared with your account, you must specify an <code>OwnerAccount</code>.</p>
pub owner_account: ::std::option::Option<::std::string::String>,
}
impl DiscoverInstancesInput {
/// <p>The <code>HttpName</code> name of the namespace. The <code>HttpName</code> is found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace. In most cases, <code>Name</code> and <code>HttpName</code> match. However, if you reuse <code>Name</code> for namespace creation, a generated hash is added to <code>HttpName</code> to distinguish the two.</p>
pub fn namespace_name(&self) -> ::std::option::Option<&str> {
self.namespace_name.as_deref()
}
/// <p>The name of the service that you specified when you registered the instance.</p>
pub fn service_name(&self) -> ::std::option::Option<&str> {
self.service_name.as_deref()
}
/// <p>The maximum number of instances that you want Cloud Map to return in the response to a <code>DiscoverInstances</code> request. If you don't specify a value for <code>MaxResults</code>, Cloud Map returns up to 100 instances.</p>
pub fn max_results(&self) -> ::std::option::Option<i32> {
self.max_results
}
/// <p>Filters to scope the results based on custom attributes for the instance (for example, <code>{version=v1, az=1a}</code>). Only instances that match all the specified key-value pairs are returned.</p>
pub fn query_parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.query_parameters.as_ref()
}
/// <p>Opportunistic filters to scope the results based on custom attributes. If there are instances that match both the filters specified in both the <code>QueryParameters</code> parameter and this parameter, all of these instances are returned. Otherwise, the filters are ignored, and only instances that match the filters that are specified in the <code>QueryParameters</code> parameter are returned.</p>
pub fn optional_parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.optional_parameters.as_ref()
}
/// <p>The health status of the instances that you want to discover. This parameter is ignored for services that don't have a health check configured, and all instances are returned.</p>
/// <dl>
/// <dt>
/// HEALTHY
/// </dt>
/// <dd>
/// <p>Returns healthy instances.</p>
/// </dd>
/// <dt>
/// UNHEALTHY
/// </dt>
/// <dd>
/// <p>Returns unhealthy instances.</p>
/// </dd>
/// <dt>
/// ALL
/// </dt>
/// <dd>
/// <p>Returns all instances.</p>
/// </dd>
/// <dt>
/// HEALTHY_OR_ELSE_ALL
/// </dt>
/// <dd>
/// <p>Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. This is also called failing open.</p>
/// </dd>
/// </dl>
pub fn health_status(&self) -> ::std::option::Option<&crate::types::HealthStatusFilter> {
self.health_status.as_ref()
}
/// <p>The ID of the Amazon Web Services account that owns the namespace associated with the instance, as specified in the namespace <code>ResourceOwner</code> field. For instances associated with namespaces that are shared with your account, you must specify an <code>OwnerAccount</code>.</p>
pub fn owner_account(&self) -> ::std::option::Option<&str> {
self.owner_account.as_deref()
}
}
impl DiscoverInstancesInput {
/// Creates a new builder-style object to manufacture [`DiscoverInstancesInput`](crate::operation::discover_instances::DiscoverInstancesInput).
pub fn builder() -> crate::operation::discover_instances::builders::DiscoverInstancesInputBuilder {
crate::operation::discover_instances::builders::DiscoverInstancesInputBuilder::default()
}
}
/// A builder for [`DiscoverInstancesInput`](crate::operation::discover_instances::DiscoverInstancesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DiscoverInstancesInputBuilder {
pub(crate) namespace_name: ::std::option::Option<::std::string::String>,
pub(crate) service_name: ::std::option::Option<::std::string::String>,
pub(crate) max_results: ::std::option::Option<i32>,
pub(crate) query_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) optional_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
pub(crate) health_status: ::std::option::Option<crate::types::HealthStatusFilter>,
pub(crate) owner_account: ::std::option::Option<::std::string::String>,
}
impl DiscoverInstancesInputBuilder {
/// <p>The <code>HttpName</code> name of the namespace. The <code>HttpName</code> is found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace. In most cases, <code>Name</code> and <code>HttpName</code> match. However, if you reuse <code>Name</code> for namespace creation, a generated hash is added to <code>HttpName</code> to distinguish the two.</p>
/// This field is required.
pub fn namespace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.namespace_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The <code>HttpName</code> name of the namespace. The <code>HttpName</code> is found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace. In most cases, <code>Name</code> and <code>HttpName</code> match. However, if you reuse <code>Name</code> for namespace creation, a generated hash is added to <code>HttpName</code> to distinguish the two.</p>
pub fn set_namespace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.namespace_name = input;
self
}
/// <p>The <code>HttpName</code> name of the namespace. The <code>HttpName</code> is found in the <code>HttpProperties</code> member of the <code>Properties</code> member of the namespace. In most cases, <code>Name</code> and <code>HttpName</code> match. However, if you reuse <code>Name</code> for namespace creation, a generated hash is added to <code>HttpName</code> to distinguish the two.</p>
pub fn get_namespace_name(&self) -> &::std::option::Option<::std::string::String> {
&self.namespace_name
}
/// <p>The name of the service that you specified when you registered the instance.</p>
/// This field is required.
pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.service_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the service that you specified when you registered the instance.</p>
pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.service_name = input;
self
}
/// <p>The name of the service that you specified when you registered the instance.</p>
pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
&self.service_name
}
/// <p>The maximum number of instances that you want Cloud Map to return in the response to a <code>DiscoverInstances</code> request. If you don't specify a value for <code>MaxResults</code>, Cloud Map returns up to 100 instances.</p>
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = ::std::option::Option::Some(input);
self
}
/// <p>The maximum number of instances that you want Cloud Map to return in the response to a <code>DiscoverInstances</code> request. If you don't specify a value for <code>MaxResults</code>, Cloud Map returns up to 100 instances.</p>
pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
/// <p>The maximum number of instances that you want Cloud Map to return in the response to a <code>DiscoverInstances</code> request. If you don't specify a value for <code>MaxResults</code>, Cloud Map returns up to 100 instances.</p>
pub fn get_max_results(&self) -> &::std::option::Option<i32> {
&self.max_results
}
/// Adds a key-value pair to `query_parameters`.
///
/// To override the contents of this collection use [`set_query_parameters`](Self::set_query_parameters).
///
/// <p>Filters to scope the results based on custom attributes for the instance (for example, <code>{version=v1, az=1a}</code>). Only instances that match all the specified key-value pairs are returned.</p>
pub fn query_parameters(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.query_parameters.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.query_parameters = ::std::option::Option::Some(hash_map);
self
}
/// <p>Filters to scope the results based on custom attributes for the instance (for example, <code>{version=v1, az=1a}</code>). Only instances that match all the specified key-value pairs are returned.</p>
pub fn set_query_parameters(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.query_parameters = input;
self
}
/// <p>Filters to scope the results based on custom attributes for the instance (for example, <code>{version=v1, az=1a}</code>). Only instances that match all the specified key-value pairs are returned.</p>
pub fn get_query_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.query_parameters
}
/// Adds a key-value pair to `optional_parameters`.
///
/// To override the contents of this collection use [`set_optional_parameters`](Self::set_optional_parameters).
///
/// <p>Opportunistic filters to scope the results based on custom attributes. If there are instances that match both the filters specified in both the <code>QueryParameters</code> parameter and this parameter, all of these instances are returned. Otherwise, the filters are ignored, and only instances that match the filters that are specified in the <code>QueryParameters</code> parameter are returned.</p>
pub fn optional_parameters(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.optional_parameters.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.optional_parameters = ::std::option::Option::Some(hash_map);
self
}
/// <p>Opportunistic filters to scope the results based on custom attributes. If there are instances that match both the filters specified in both the <code>QueryParameters</code> parameter and this parameter, all of these instances are returned. Otherwise, the filters are ignored, and only instances that match the filters that are specified in the <code>QueryParameters</code> parameter are returned.</p>
pub fn set_optional_parameters(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.optional_parameters = input;
self
}
/// <p>Opportunistic filters to scope the results based on custom attributes. If there are instances that match both the filters specified in both the <code>QueryParameters</code> parameter and this parameter, all of these instances are returned. Otherwise, the filters are ignored, and only instances that match the filters that are specified in the <code>QueryParameters</code> parameter are returned.</p>
pub fn get_optional_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.optional_parameters
}
/// <p>The health status of the instances that you want to discover. This parameter is ignored for services that don't have a health check configured, and all instances are returned.</p>
/// <dl>
/// <dt>
/// HEALTHY
/// </dt>
/// <dd>
/// <p>Returns healthy instances.</p>
/// </dd>
/// <dt>
/// UNHEALTHY
/// </dt>
/// <dd>
/// <p>Returns unhealthy instances.</p>
/// </dd>
/// <dt>
/// ALL
/// </dt>
/// <dd>
/// <p>Returns all instances.</p>
/// </dd>
/// <dt>
/// HEALTHY_OR_ELSE_ALL
/// </dt>
/// <dd>
/// <p>Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. This is also called failing open.</p>
/// </dd>
/// </dl>
pub fn health_status(mut self, input: crate::types::HealthStatusFilter) -> Self {
self.health_status = ::std::option::Option::Some(input);
self
}
/// <p>The health status of the instances that you want to discover. This parameter is ignored for services that don't have a health check configured, and all instances are returned.</p>
/// <dl>
/// <dt>
/// HEALTHY
/// </dt>
/// <dd>
/// <p>Returns healthy instances.</p>
/// </dd>
/// <dt>
/// UNHEALTHY
/// </dt>
/// <dd>
/// <p>Returns unhealthy instances.</p>
/// </dd>
/// <dt>
/// ALL
/// </dt>
/// <dd>
/// <p>Returns all instances.</p>
/// </dd>
/// <dt>
/// HEALTHY_OR_ELSE_ALL
/// </dt>
/// <dd>
/// <p>Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. This is also called failing open.</p>
/// </dd>
/// </dl>
pub fn set_health_status(mut self, input: ::std::option::Option<crate::types::HealthStatusFilter>) -> Self {
self.health_status = input;
self
}
/// <p>The health status of the instances that you want to discover. This parameter is ignored for services that don't have a health check configured, and all instances are returned.</p>
/// <dl>
/// <dt>
/// HEALTHY
/// </dt>
/// <dd>
/// <p>Returns healthy instances.</p>
/// </dd>
/// <dt>
/// UNHEALTHY
/// </dt>
/// <dd>
/// <p>Returns unhealthy instances.</p>
/// </dd>
/// <dt>
/// ALL
/// </dt>
/// <dd>
/// <p>Returns all instances.</p>
/// </dd>
/// <dt>
/// HEALTHY_OR_ELSE_ALL
/// </dt>
/// <dd>
/// <p>Returns healthy instances, unless none are reporting a healthy state. In that case, return all instances. This is also called failing open.</p>
/// </dd>
/// </dl>
pub fn get_health_status(&self) -> &::std::option::Option<crate::types::HealthStatusFilter> {
&self.health_status
}
/// <p>The ID of the Amazon Web Services account that owns the namespace associated with the instance, as specified in the namespace <code>ResourceOwner</code> field. For instances associated with namespaces that are shared with your account, you must specify an <code>OwnerAccount</code>.</p>
pub fn owner_account(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.owner_account = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the Amazon Web Services account that owns the namespace associated with the instance, as specified in the namespace <code>ResourceOwner</code> field. For instances associated with namespaces that are shared with your account, you must specify an <code>OwnerAccount</code>.</p>
pub fn set_owner_account(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.owner_account = input;
self
}
/// <p>The ID of the Amazon Web Services account that owns the namespace associated with the instance, as specified in the namespace <code>ResourceOwner</code> field. For instances associated with namespaces that are shared with your account, you must specify an <code>OwnerAccount</code>.</p>
pub fn get_owner_account(&self) -> &::std::option::Option<::std::string::String> {
&self.owner_account
}
/// Consumes the builder and constructs a [`DiscoverInstancesInput`](crate::operation::discover_instances::DiscoverInstancesInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::discover_instances::DiscoverInstancesInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::discover_instances::DiscoverInstancesInput {
namespace_name: self.namespace_name,
service_name: self.service_name,
max_results: self.max_results,
query_parameters: self.query_parameters,
optional_parameters: self.optional_parameters,
health_status: self.health_status,
owner_account: self.owner_account,
})
}
}