aws_sdk_opsworks/operation/register_instance/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::register_instance::_register_instance_output::RegisterInstanceOutputBuilder;
3
4pub use crate::operation::register_instance::_register_instance_input::RegisterInstanceInputBuilder;
5
6impl crate::operation::register_instance::builders::RegisterInstanceInputBuilder {
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_instance::RegisterInstanceOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::register_instance::RegisterInstanceError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.register_instance();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `RegisterInstance`.
24///
25/// <p>Registers instances that were created outside of OpsWorks Stacks with a specified stack.</p><note>
26/// <p>We do not recommend using this action to register instances. The complete registration operation includes two tasks: installing the OpsWorks Stacks agent on the instance, and registering the instance with the stack. <code>RegisterInstance</code> handles only the second step. You should instead use the CLI <code>register</code> command, which performs the entire registration operation. For more information, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/registered-instances-register.html"> Registering an Instance with an OpsWorks Stacks Stack</a>.</p>
27/// </note>
28/// <p>Registered instances have the same requirements as instances that are created by using the <code>CreateInstance</code> API. For example, registered instances must be running a supported Linux-based operating system, and they must have a supported instance type. For more information about requirements for instances that you want to register, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/registered-instances-register-registering-preparer.html"> Preparing the Instance</a>.</p>
29/// <p><b>Required Permissions</b>: To use this action, an IAM user must have a Manage permissions level for the stack or an attached policy that explicitly grants permissions. For more information on user permissions, see <a href="https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-users.html">Managing User Permissions</a>.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct RegisterInstanceFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::register_instance::builders::RegisterInstanceInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::register_instance::RegisterInstanceOutput,
39        crate::operation::register_instance::RegisterInstanceError,
40    > for RegisterInstanceFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<
47            crate::operation::register_instance::RegisterInstanceOutput,
48            crate::operation::register_instance::RegisterInstanceError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl RegisterInstanceFluentBuilder {
55    /// Creates a new `RegisterInstanceFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the RegisterInstance as a reference.
64    pub fn as_input(&self) -> &crate::operation::register_instance::builders::RegisterInstanceInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::register_instance::RegisterInstanceOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::register_instance::RegisterInstanceError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::register_instance::RegisterInstance::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::register_instance::RegisterInstance::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::register_instance::RegisterInstanceOutput,
101        crate::operation::register_instance::RegisterInstanceError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    /// <p>The ID of the stack that the instance is to be registered with.</p>
116    pub fn stack_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.inner = self.inner.stack_id(input.into());
118        self
119    }
120    /// <p>The ID of the stack that the instance is to be registered with.</p>
121    pub fn set_stack_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_stack_id(input);
123        self
124    }
125    /// <p>The ID of the stack that the instance is to be registered with.</p>
126    pub fn get_stack_id(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_stack_id()
128    }
129    /// <p>The instance's host name. The following are character limits for instance host names.</p>
130    /// <ul>
131    /// <li>
132    /// <p>Linux-based instances: 63 characters</p></li>
133    /// <li>
134    /// <p>Windows-based instances: 15 characters</p></li>
135    /// </ul>
136    pub fn hostname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.hostname(input.into());
138        self
139    }
140    /// <p>The instance's host name. The following are character limits for instance host names.</p>
141    /// <ul>
142    /// <li>
143    /// <p>Linux-based instances: 63 characters</p></li>
144    /// <li>
145    /// <p>Windows-based instances: 15 characters</p></li>
146    /// </ul>
147    pub fn set_hostname(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_hostname(input);
149        self
150    }
151    /// <p>The instance's host name. The following are character limits for instance host names.</p>
152    /// <ul>
153    /// <li>
154    /// <p>Linux-based instances: 63 characters</p></li>
155    /// <li>
156    /// <p>Windows-based instances: 15 characters</p></li>
157    /// </ul>
158    pub fn get_hostname(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_hostname()
160    }
161    /// <p>The instance's public IP address.</p>
162    pub fn public_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.public_ip(input.into());
164        self
165    }
166    /// <p>The instance's public IP address.</p>
167    pub fn set_public_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_public_ip(input);
169        self
170    }
171    /// <p>The instance's public IP address.</p>
172    pub fn get_public_ip(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_public_ip()
174    }
175    /// <p>The instance's private IP address.</p>
176    pub fn private_ip(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.private_ip(input.into());
178        self
179    }
180    /// <p>The instance's private IP address.</p>
181    pub fn set_private_ip(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_private_ip(input);
183        self
184    }
185    /// <p>The instance's private IP address.</p>
186    pub fn get_private_ip(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_private_ip()
188    }
189    /// <p>The instances public RSA key. This key is used to encrypt communication between the instance and the service.</p>
190    pub fn rsa_public_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.rsa_public_key(input.into());
192        self
193    }
194    /// <p>The instances public RSA key. This key is used to encrypt communication between the instance and the service.</p>
195    pub fn set_rsa_public_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.inner = self.inner.set_rsa_public_key(input);
197        self
198    }
199    /// <p>The instances public RSA key. This key is used to encrypt communication between the instance and the service.</p>
200    pub fn get_rsa_public_key(&self) -> &::std::option::Option<::std::string::String> {
201        self.inner.get_rsa_public_key()
202    }
203    /// <p>The instances public RSA key fingerprint.</p>
204    pub fn rsa_public_key_fingerprint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.inner = self.inner.rsa_public_key_fingerprint(input.into());
206        self
207    }
208    /// <p>The instances public RSA key fingerprint.</p>
209    pub fn set_rsa_public_key_fingerprint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.inner = self.inner.set_rsa_public_key_fingerprint(input);
211        self
212    }
213    /// <p>The instances public RSA key fingerprint.</p>
214    pub fn get_rsa_public_key_fingerprint(&self) -> &::std::option::Option<::std::string::String> {
215        self.inner.get_rsa_public_key_fingerprint()
216    }
217    /// <p>An InstanceIdentity object that contains the instance's identity.</p>
218    pub fn instance_identity(mut self, input: crate::types::InstanceIdentity) -> Self {
219        self.inner = self.inner.instance_identity(input);
220        self
221    }
222    /// <p>An InstanceIdentity object that contains the instance's identity.</p>
223    pub fn set_instance_identity(mut self, input: ::std::option::Option<crate::types::InstanceIdentity>) -> Self {
224        self.inner = self.inner.set_instance_identity(input);
225        self
226    }
227    /// <p>An InstanceIdentity object that contains the instance's identity.</p>
228    pub fn get_instance_identity(&self) -> &::std::option::Option<crate::types::InstanceIdentity> {
229        self.inner.get_instance_identity()
230    }
231}