aws_sdk_ecs/operation/register_container_instance/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::register_container_instance::_register_container_instance_output::RegisterContainerInstanceOutputBuilder;
3
4pub use crate::operation::register_container_instance::_register_container_instance_input::RegisterContainerInstanceInputBuilder;
5
6impl crate::operation::register_container_instance::builders::RegisterContainerInstanceInputBuilder {
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::register_container_instance::RegisterContainerInstanceOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::register_container_instance::RegisterContainerInstanceError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.register_container_instance();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `RegisterContainerInstance`.
24///
25/// <note>
26/// <p>This action is only used by the Amazon ECS agent, and it is not intended for use outside of the agent.</p>
27/// </note>
28/// <p>Registers an EC2 instance into the specified cluster. This instance becomes available to place containers on.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct RegisterContainerInstanceFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::register_container_instance::builders::RegisterContainerInstanceInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::register_container_instance::RegisterContainerInstanceOutput,
38 crate::operation::register_container_instance::RegisterContainerInstanceError,
39 > for RegisterContainerInstanceFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::register_container_instance::RegisterContainerInstanceOutput,
47 crate::operation::register_container_instance::RegisterContainerInstanceError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl RegisterContainerInstanceFluentBuilder {
54 /// Creates a new `RegisterContainerInstanceFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the RegisterContainerInstance as a reference.
63 pub fn as_input(&self) -> &crate::operation::register_container_instance::builders::RegisterContainerInstanceInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::register_container_instance::RegisterContainerInstanceOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::register_container_instance::RegisterContainerInstanceError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::register_container_instance::RegisterContainerInstance::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::register_container_instance::RegisterContainerInstance::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::register_container_instance::RegisterContainerInstanceOutput,
100 crate::operation::register_container_instance::RegisterContainerInstanceError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster to register your container instance with. If you do not specify a cluster, the default cluster is assumed.</p>
115 pub fn cluster(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.cluster(input.into());
117 self
118 }
119 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster to register your container instance with. If you do not specify a cluster, the default cluster is assumed.</p>
120 pub fn set_cluster(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_cluster(input);
122 self
123 }
124 /// <p>The short name or full Amazon Resource Name (ARN) of the cluster to register your container instance with. If you do not specify a cluster, the default cluster is assumed.</p>
125 pub fn get_cluster(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_cluster()
127 }
128 /// <p>The instance identity document for the EC2 instance to register. This document can be found by running the following command from the instance: <code>curl http://169.254.169.254/latest/dynamic/instance-identity/document/</code></p>
129 pub fn instance_identity_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.inner = self.inner.instance_identity_document(input.into());
131 self
132 }
133 /// <p>The instance identity document for the EC2 instance to register. This document can be found by running the following command from the instance: <code>curl http://169.254.169.254/latest/dynamic/instance-identity/document/</code></p>
134 pub fn set_instance_identity_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_instance_identity_document(input);
136 self
137 }
138 /// <p>The instance identity document for the EC2 instance to register. This document can be found by running the following command from the instance: <code>curl http://169.254.169.254/latest/dynamic/instance-identity/document/</code></p>
139 pub fn get_instance_identity_document(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_instance_identity_document()
141 }
142 /// <p>The instance identity document signature for the EC2 instance to register. This signature can be found by running the following command from the instance: <code>curl http://169.254.169.254/latest/dynamic/instance-identity/signature/</code></p>
143 pub fn instance_identity_document_signature(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.inner = self.inner.instance_identity_document_signature(input.into());
145 self
146 }
147 /// <p>The instance identity document signature for the EC2 instance to register. This signature can be found by running the following command from the instance: <code>curl http://169.254.169.254/latest/dynamic/instance-identity/signature/</code></p>
148 pub fn set_instance_identity_document_signature(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.inner = self.inner.set_instance_identity_document_signature(input);
150 self
151 }
152 /// <p>The instance identity document signature for the EC2 instance to register. This signature can be found by running the following command from the instance: <code>curl http://169.254.169.254/latest/dynamic/instance-identity/signature/</code></p>
153 pub fn get_instance_identity_document_signature(&self) -> &::std::option::Option<::std::string::String> {
154 self.inner.get_instance_identity_document_signature()
155 }
156 ///
157 /// Appends an item to `totalResources`.
158 ///
159 /// To override the contents of this collection use [`set_total_resources`](Self::set_total_resources).
160 ///
161 /// <p>The resources available on the instance.</p>
162 pub fn total_resources(mut self, input: crate::types::Resource) -> Self {
163 self.inner = self.inner.total_resources(input);
164 self
165 }
166 /// <p>The resources available on the instance.</p>
167 pub fn set_total_resources(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Resource>>) -> Self {
168 self.inner = self.inner.set_total_resources(input);
169 self
170 }
171 /// <p>The resources available on the instance.</p>
172 pub fn get_total_resources(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Resource>> {
173 self.inner.get_total_resources()
174 }
175 /// <p>The version information for the Amazon ECS container agent and Docker daemon that runs on the container instance.</p>
176 pub fn version_info(mut self, input: crate::types::VersionInfo) -> Self {
177 self.inner = self.inner.version_info(input);
178 self
179 }
180 /// <p>The version information for the Amazon ECS container agent and Docker daemon that runs on the container instance.</p>
181 pub fn set_version_info(mut self, input: ::std::option::Option<crate::types::VersionInfo>) -> Self {
182 self.inner = self.inner.set_version_info(input);
183 self
184 }
185 /// <p>The version information for the Amazon ECS container agent and Docker daemon that runs on the container instance.</p>
186 pub fn get_version_info(&self) -> &::std::option::Option<crate::types::VersionInfo> {
187 self.inner.get_version_info()
188 }
189 /// <p>The ARN of the container instance (if it was previously registered).</p>
190 pub fn container_instance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.inner = self.inner.container_instance_arn(input.into());
192 self
193 }
194 /// <p>The ARN of the container instance (if it was previously registered).</p>
195 pub fn set_container_instance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.inner = self.inner.set_container_instance_arn(input);
197 self
198 }
199 /// <p>The ARN of the container instance (if it was previously registered).</p>
200 pub fn get_container_instance_arn(&self) -> &::std::option::Option<::std::string::String> {
201 self.inner.get_container_instance_arn()
202 }
203 ///
204 /// Appends an item to `attributes`.
205 ///
206 /// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
207 ///
208 /// <p>The container instance attributes that this container instance supports.</p>
209 pub fn attributes(mut self, input: crate::types::Attribute) -> Self {
210 self.inner = self.inner.attributes(input);
211 self
212 }
213 /// <p>The container instance attributes that this container instance supports.</p>
214 pub fn set_attributes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Attribute>>) -> Self {
215 self.inner = self.inner.set_attributes(input);
216 self
217 }
218 /// <p>The container instance attributes that this container instance supports.</p>
219 pub fn get_attributes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Attribute>> {
220 self.inner.get_attributes()
221 }
222 ///
223 /// Appends an item to `platformDevices`.
224 ///
225 /// To override the contents of this collection use [`set_platform_devices`](Self::set_platform_devices).
226 ///
227 /// <p>The devices that are available on the container instance. The only supported device type is a GPU.</p>
228 pub fn platform_devices(mut self, input: crate::types::PlatformDevice) -> Self {
229 self.inner = self.inner.platform_devices(input);
230 self
231 }
232 /// <p>The devices that are available on the container instance. The only supported device type is a GPU.</p>
233 pub fn set_platform_devices(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PlatformDevice>>) -> Self {
234 self.inner = self.inner.set_platform_devices(input);
235 self
236 }
237 /// <p>The devices that are available on the container instance. The only supported device type is a GPU.</p>
238 pub fn get_platform_devices(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PlatformDevice>> {
239 self.inner.get_platform_devices()
240 }
241 ///
242 /// Appends an item to `tags`.
243 ///
244 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
245 ///
246 /// <p>The metadata that you apply to the container instance to help you categorize and organize them. Each tag consists of a key and an optional value. You define both.</p>
247 /// <p>The following basic restrictions apply to tags:</p>
248 /// <ul>
249 /// <li>
250 /// <p>Maximum number of tags per resource - 50</p></li>
251 /// <li>
252 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
253 /// <li>
254 /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
255 /// <li>
256 /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
257 /// <li>
258 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
259 /// <li>
260 /// <p>Tag keys and values are case-sensitive.</p></li>
261 /// <li>
262 /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.</p></li>
263 /// </ul>
264 pub fn tags(mut self, input: crate::types::Tag) -> Self {
265 self.inner = self.inner.tags(input);
266 self
267 }
268 /// <p>The metadata that you apply to the container instance to help you categorize and organize them. Each tag consists of a key and an optional value. You define both.</p>
269 /// <p>The following basic restrictions apply to tags:</p>
270 /// <ul>
271 /// <li>
272 /// <p>Maximum number of tags per resource - 50</p></li>
273 /// <li>
274 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
275 /// <li>
276 /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
277 /// <li>
278 /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
279 /// <li>
280 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
281 /// <li>
282 /// <p>Tag keys and values are case-sensitive.</p></li>
283 /// <li>
284 /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.</p></li>
285 /// </ul>
286 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
287 self.inner = self.inner.set_tags(input);
288 self
289 }
290 /// <p>The metadata that you apply to the container instance to help you categorize and organize them. Each tag consists of a key and an optional value. You define both.</p>
291 /// <p>The following basic restrictions apply to tags:</p>
292 /// <ul>
293 /// <li>
294 /// <p>Maximum number of tags per resource - 50</p></li>
295 /// <li>
296 /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
297 /// <li>
298 /// <p>Maximum key length - 128 Unicode characters in UTF-8</p></li>
299 /// <li>
300 /// <p>Maximum value length - 256 Unicode characters in UTF-8</p></li>
301 /// <li>
302 /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
303 /// <li>
304 /// <p>Tag keys and values are case-sensitive.</p></li>
305 /// <li>
306 /// <p>Do not use <code>aws:</code>, <code>AWS:</code>, or any upper or lowercase combination of such as a prefix for either keys or values as it is reserved for Amazon Web Services use. You cannot edit or delete tag keys or values with this prefix. Tags with this prefix do not count against your tags per resource limit.</p></li>
307 /// </ul>
308 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
309 self.inner.get_tags()
310 }
311}