aws_sdk_ssm/client/
start_session.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2impl super::Client {
3    /// Constructs a fluent builder for the [`StartSession`](crate::operation::start_session::builders::StartSessionFluentBuilder) operation.
4    ///
5    /// - The fluent builder is configurable:
6    ///   - [`target(impl Into<String>)`](crate::operation::start_session::builders::StartSessionFluentBuilder::target) / [`set_target(Option<String>)`](crate::operation::start_session::builders::StartSessionFluentBuilder::set_target):<br>required: **true**<br><p>The managed node to connect to for the session.</p><br>
7    ///   - [`document_name(impl Into<String>)`](crate::operation::start_session::builders::StartSessionFluentBuilder::document_name) / [`set_document_name(Option<String>)`](crate::operation::start_session::builders::StartSessionFluentBuilder::set_document_name):<br>required: **false**<br><p>The name of the SSM document you want to use to define the type of session, input parameters, or preferences for the session. For example, <code>SSM-SessionManagerRunShell</code>. You can call the <code>GetDocument</code> API to verify the document exists before attempting to start a session. If no document name is provided, a shell to the managed node is launched by default. For more information, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-sessions-start.html">Start a session</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p><br>
8    ///   - [`reason(impl Into<String>)`](crate::operation::start_session::builders::StartSessionFluentBuilder::reason) / [`set_reason(Option<String>)`](crate::operation::start_session::builders::StartSessionFluentBuilder::set_reason):<br>required: **false**<br><p>The reason for connecting to the instance. This value is included in the details for the Amazon CloudWatch Events event created when you start the session.</p><br>
9    ///   - [`parameters(impl Into<String>, Vec::<String>)`](crate::operation::start_session::builders::StartSessionFluentBuilder::parameters) / [`set_parameters(Option<HashMap::<String, Vec::<String>>>)`](crate::operation::start_session::builders::StartSessionFluentBuilder::set_parameters):<br>required: **false**<br><p>The values you want to specify for the parameters defined in the Session document. For more information about these parameters, see <a href="https://docs.aws.amazon.com/systems-manager/latest/userguide/getting-started-create-preferences-cli.html">Create a Session Manager preferences document</a> in the <i>Amazon Web Services Systems Manager User Guide</i>.</p><br>
10    /// - On success, responds with [`StartSessionOutput`](crate::operation::start_session::StartSessionOutput) with field(s):
11    ///   - [`session_id(Option<String>)`](crate::operation::start_session::StartSessionOutput::session_id): <p>The ID of the session.</p>
12    ///   - [`token_value(Option<String>)`](crate::operation::start_session::StartSessionOutput::token_value): <p>An encrypted token value containing session and caller information. This token is used to authenticate the connection to the managed node, and is valid only long enough to ensure the connection is successful. Never share your session's token.</p>
13    ///   - [`stream_url(Option<String>)`](crate::operation::start_session::StartSessionOutput::stream_url): <p>A URL back to SSM Agent on the managed node that the Session Manager client uses to send commands and receive output from the node. Format: <code>wss://ssmmessages.<b>region</b>.amazonaws.com/v1/data-channel/<b>session-id</b>?stream=(input|output)</code></p> <p><b>region</b> represents the Region identifier for an Amazon Web Services Region supported by Amazon Web Services Systems Manager, such as <code>us-east-2</code> for the US East (Ohio) Region. For a list of supported <b>region</b> values, see the <b>Region</b> column in <a href="https://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region">Systems Manager service endpoints</a> in the <i>Amazon Web Services General Reference</i>.</p> <p><b>session-id</b> represents the ID of a Session Manager session, such as <code>1a2b3c4dEXAMPLE</code>.</p>
14    /// - On failure, responds with [`SdkError<StartSessionError>`](crate::operation::start_session::StartSessionError)
15    pub fn start_session(&self) -> crate::operation::start_session::builders::StartSessionFluentBuilder {
16        crate::operation::start_session::builders::StartSessionFluentBuilder::new(self.handle.clone())
17    }
18}