aws_sdk_ec2/operation/describe_instance_topology/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_instance_topology::_describe_instance_topology_output::DescribeInstanceTopologyOutputBuilder;
3
4pub use crate::operation::describe_instance_topology::_describe_instance_topology_input::DescribeInstanceTopologyInputBuilder;
5
6impl crate::operation::describe_instance_topology::builders::DescribeInstanceTopologyInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::describe_instance_topology::DescribeInstanceTopologyOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::describe_instance_topology::DescribeInstanceTopologyError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.describe_instance_topology();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DescribeInstanceTopology`.
24///
25/// <p>Describes a tree-based hierarchy that represents the physical host placement of your EC2 instances within an Availability Zone or Local Zone. You can use this information to determine the relative proximity of your EC2 instances within the Amazon Web Services network to support your tightly coupled workloads.</p>
26/// <p class="title"><b>Limitations</b></p>
27/// <ul>
28/// <li>
29/// <p>Supported zones</p>
30/// <ul>
31/// <li>
32/// <p>Availability Zone</p></li>
33/// <li>
34/// <p>Local Zone</p></li>
35/// </ul></li>
36/// <li>
37/// <p>Supported instance types</p>
38/// <ul>
39/// <li>
40/// <p>Returns 3 network nodes in the response</p>
41/// <ul>
42/// <li>
43/// <p><code>hpc6a.48xlarge</code> | <code>hpc6id.32xlarge</code> | <code>hpc7a.12xlarge</code> | <code>hpc7a.24xlarge</code> | <code>hpc7a.48xlarge</code> | <code>hpc7a.96xlarge</code> | <code>hpc7g.4xlarge</code> | <code>hpc7g.8xlarge</code> | <code>hpc7g.16xlarge</code></p></li>
44/// <li>
45/// <p><code>p3dn.24xlarge</code> | <code>p4d.24xlarge</code> | <code>p4de.24xlarge</code> | <code>p5.48xlarge</code> | <code>p5e.48xlarge</code> | <code>p5en.48xlarge</code></p></li>
46/// <li>
47/// <p><code>trn1.2xlarge</code> | <code>trn1.32xlarge</code> | <code>trn1n.32xlarge</code> | <code>trn2.48xlarge</code> | <code>trn2u.48xlarge</code></p></li>
48/// </ul></li>
49/// <li>
50/// <p>Returns 4 network nodes in the response</p>
51/// <ul>
52/// <li>
53/// <p><code>p6-b200.48xlarge</code></p></li>
54/// </ul></li>
55/// </ul></li>
56/// </ul>
57/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-topology.html">Amazon EC2 instance topology</a> in the <i>Amazon EC2 User Guide</i>.</p>
58#[derive(::std::clone::Clone, ::std::fmt::Debug)]
59pub struct DescribeInstanceTopologyFluentBuilder {
60 handle: ::std::sync::Arc<crate::client::Handle>,
61 inner: crate::operation::describe_instance_topology::builders::DescribeInstanceTopologyInputBuilder,
62 config_override: ::std::option::Option<crate::config::Builder>,
63}
64impl
65 crate::client::customize::internal::CustomizableSend<
66 crate::operation::describe_instance_topology::DescribeInstanceTopologyOutput,
67 crate::operation::describe_instance_topology::DescribeInstanceTopologyError,
68 > for DescribeInstanceTopologyFluentBuilder
69{
70 fn send(
71 self,
72 config_override: crate::config::Builder,
73 ) -> crate::client::customize::internal::BoxFuture<
74 crate::client::customize::internal::SendResult<
75 crate::operation::describe_instance_topology::DescribeInstanceTopologyOutput,
76 crate::operation::describe_instance_topology::DescribeInstanceTopologyError,
77 >,
78 > {
79 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
80 }
81}
82impl DescribeInstanceTopologyFluentBuilder {
83 /// Creates a new `DescribeInstanceTopologyFluentBuilder`.
84 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
85 Self {
86 handle,
87 inner: ::std::default::Default::default(),
88 config_override: ::std::option::Option::None,
89 }
90 }
91 /// Access the DescribeInstanceTopology as a reference.
92 pub fn as_input(&self) -> &crate::operation::describe_instance_topology::builders::DescribeInstanceTopologyInputBuilder {
93 &self.inner
94 }
95 /// Sends the request and returns the response.
96 ///
97 /// If an error occurs, an `SdkError` will be returned with additional details that
98 /// can be matched against.
99 ///
100 /// By default, any retryable failures will be retried twice. Retry behavior
101 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
102 /// set when configuring the client.
103 pub async fn send(
104 self,
105 ) -> ::std::result::Result<
106 crate::operation::describe_instance_topology::DescribeInstanceTopologyOutput,
107 ::aws_smithy_runtime_api::client::result::SdkError<
108 crate::operation::describe_instance_topology::DescribeInstanceTopologyError,
109 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
110 >,
111 > {
112 let input = self
113 .inner
114 .build()
115 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
116 let runtime_plugins = crate::operation::describe_instance_topology::DescribeInstanceTopology::operation_runtime_plugins(
117 self.handle.runtime_plugins.clone(),
118 &self.handle.conf,
119 self.config_override,
120 );
121 crate::operation::describe_instance_topology::DescribeInstanceTopology::orchestrate(&runtime_plugins, input).await
122 }
123
124 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
125 pub fn customize(
126 self,
127 ) -> crate::client::customize::CustomizableOperation<
128 crate::operation::describe_instance_topology::DescribeInstanceTopologyOutput,
129 crate::operation::describe_instance_topology::DescribeInstanceTopologyError,
130 Self,
131 > {
132 crate::client::customize::CustomizableOperation::new(self)
133 }
134 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
135 self.set_config_override(::std::option::Option::Some(config_override.into()));
136 self
137 }
138
139 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
140 self.config_override = config_override;
141 self
142 }
143 /// Create a paginator for this request
144 ///
145 /// Paginators are used by calling [`send().await`](crate::operation::describe_instance_topology::paginator::DescribeInstanceTopologyPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
146 pub fn into_paginator(self) -> crate::operation::describe_instance_topology::paginator::DescribeInstanceTopologyPaginator {
147 crate::operation::describe_instance_topology::paginator::DescribeInstanceTopologyPaginator::new(self.handle, self.inner)
148 }
149 /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
150 pub fn dry_run(mut self, input: bool) -> Self {
151 self.inner = self.inner.dry_run(input);
152 self
153 }
154 /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
155 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
156 self.inner = self.inner.set_dry_run(input);
157 self
158 }
159 /// <p>Checks whether you have the required permissions for the operation, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
160 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
161 self.inner.get_dry_run()
162 }
163 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
164 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165 self.inner = self.inner.next_token(input.into());
166 self
167 }
168 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
169 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170 self.inner = self.inner.set_next_token(input);
171 self
172 }
173 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
174 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
175 self.inner.get_next_token()
176 }
177 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
178 /// <p>You can't specify this parameter and the instance IDs parameter in the same request.</p>
179 /// <p>Default: <code>20</code></p>
180 pub fn max_results(mut self, input: i32) -> Self {
181 self.inner = self.inner.max_results(input);
182 self
183 }
184 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
185 /// <p>You can't specify this parameter and the instance IDs parameter in the same request.</p>
186 /// <p>Default: <code>20</code></p>
187 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
188 self.inner = self.inner.set_max_results(input);
189 self
190 }
191 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
192 /// <p>You can't specify this parameter and the instance IDs parameter in the same request.</p>
193 /// <p>Default: <code>20</code></p>
194 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
195 self.inner.get_max_results()
196 }
197 ///
198 /// Appends an item to `InstanceIds`.
199 ///
200 /// To override the contents of this collection use [`set_instance_ids`](Self::set_instance_ids).
201 ///
202 /// <p>The instance IDs.</p>
203 /// <p>Default: Describes all your instances.</p>
204 /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
205 pub fn instance_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206 self.inner = self.inner.instance_ids(input.into());
207 self
208 }
209 /// <p>The instance IDs.</p>
210 /// <p>Default: Describes all your instances.</p>
211 /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
212 pub fn set_instance_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
213 self.inner = self.inner.set_instance_ids(input);
214 self
215 }
216 /// <p>The instance IDs.</p>
217 /// <p>Default: Describes all your instances.</p>
218 /// <p>Constraints: Maximum 100 explicitly specified instance IDs.</p>
219 pub fn get_instance_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
220 self.inner.get_instance_ids()
221 }
222 ///
223 /// Appends an item to `GroupNames`.
224 ///
225 /// To override the contents of this collection use [`set_group_names`](Self::set_group_names).
226 ///
227 /// <p>The name of the placement group that each instance is in.</p>
228 /// <p>Constraints: Maximum 100 explicitly specified placement group names.</p>
229 pub fn group_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230 self.inner = self.inner.group_names(input.into());
231 self
232 }
233 /// <p>The name of the placement group that each instance is in.</p>
234 /// <p>Constraints: Maximum 100 explicitly specified placement group names.</p>
235 pub fn set_group_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
236 self.inner = self.inner.set_group_names(input);
237 self
238 }
239 /// <p>The name of the placement group that each instance is in.</p>
240 /// <p>Constraints: Maximum 100 explicitly specified placement group names.</p>
241 pub fn get_group_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
242 self.inner.get_group_names()
243 }
244 ///
245 /// Appends an item to `Filters`.
246 ///
247 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
248 ///
249 /// <p>The filters.</p>
250 /// <ul>
251 /// <li>
252 /// <p><code>availability-zone</code> - The name of the Availability Zone (for example, <code>us-west-2a</code>) or Local Zone (for example, <code>us-west-2-lax-1b</code>) that the instance is in.</p></li>
253 /// <li>
254 /// <p><code>instance-type</code> - The instance type (for example, <code>p4d.24xlarge</code>) or instance family (for example, <code>p4d*</code>). You can use the <code>*</code> wildcard to match zero or more characters, or the <code>?</code> wildcard to match zero or one character.</p></li>
255 /// <li>
256 /// <p><code>zone-id</code> - The ID of the Availability Zone (for example, <code>usw2-az2</code>) or Local Zone (for example, <code>usw2-lax1-az1</code>) that the instance is in.</p></li>
257 /// </ul>
258 pub fn filters(mut self, input: crate::types::Filter) -> Self {
259 self.inner = self.inner.filters(input);
260 self
261 }
262 /// <p>The filters.</p>
263 /// <ul>
264 /// <li>
265 /// <p><code>availability-zone</code> - The name of the Availability Zone (for example, <code>us-west-2a</code>) or Local Zone (for example, <code>us-west-2-lax-1b</code>) that the instance is in.</p></li>
266 /// <li>
267 /// <p><code>instance-type</code> - The instance type (for example, <code>p4d.24xlarge</code>) or instance family (for example, <code>p4d*</code>). You can use the <code>*</code> wildcard to match zero or more characters, or the <code>?</code> wildcard to match zero or one character.</p></li>
268 /// <li>
269 /// <p><code>zone-id</code> - The ID of the Availability Zone (for example, <code>usw2-az2</code>) or Local Zone (for example, <code>usw2-lax1-az1</code>) that the instance is in.</p></li>
270 /// </ul>
271 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
272 self.inner = self.inner.set_filters(input);
273 self
274 }
275 /// <p>The filters.</p>
276 /// <ul>
277 /// <li>
278 /// <p><code>availability-zone</code> - The name of the Availability Zone (for example, <code>us-west-2a</code>) or Local Zone (for example, <code>us-west-2-lax-1b</code>) that the instance is in.</p></li>
279 /// <li>
280 /// <p><code>instance-type</code> - The instance type (for example, <code>p4d.24xlarge</code>) or instance family (for example, <code>p4d*</code>). You can use the <code>*</code> wildcard to match zero or more characters, or the <code>?</code> wildcard to match zero or one character.</p></li>
281 /// <li>
282 /// <p><code>zone-id</code> - The ID of the Availability Zone (for example, <code>usw2-az2</code>) or Local Zone (for example, <code>usw2-lax1-az1</code>) that the instance is in.</p></li>
283 /// </ul>
284 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
285 self.inner.get_filters()
286 }
287}