Skip to main content

aws_sdk_redshiftdata/client/
list_sessions.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 [`ListSessions`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder) operation.
4    /// This operation supports pagination; See [`into_paginator()`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::into_paginator).
5    ///
6    /// - The fluent builder is configurable:
7    ///   - [`next_token(impl Into<String>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::next_token) / [`set_next_token(Option<String>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::set_next_token):<br>required: **false**<br><p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.</p><br>
8    ///   - [`max_results(i32)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::max_results) / [`set_max_results(Option<i32>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::set_max_results):<br>required: **false**<br><p>The maximum number of sessions to return in the response. If more sessions exist than fit in one response, the operation returns <code>NextToken</code> to paginate the results.</p><br>
9    ///   - [`session_id(impl Into<String>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::session_id) / [`set_session_id(Option<String>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::set_session_id):<br>required: **false**<br><p>The identifier of a specific session to return metadata for. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. When you provide <code>SessionId</code>, you can't specify <code>Status</code>, <code>ClusterIdentifier</code>, <code>WorkgroupName</code>, or <code>Database</code>.</p><br>
10    ///   - [`status(SessionStatusString)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::status) / [`set_status(Option<SessionStatusString>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::set_status):<br>required: **false**<br><p>The status of the sessions to list. If no status is specified, sessions with a status of <code>AVAILABLE</code> or <code>BUSY</code> are returned. Status values are defined as follows:</p> <ul>  <li>   <p>AVAILABLE – The session is open and ready to run a SQL statement.</p></li>  <li>   <p>BUSY – The session is currently running a SQL statement.</p></li>  <li>   <p>CLOSED – The session is closed and can no longer run SQL statements.</p></li> </ul><br>
11    ///   - [`role_level(bool)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::role_level) / [`set_role_level(Option<bool>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::set_role_level):<br>required: **false**<br><p>Specifies whether to return all sessions created by the caller's IAM role, including sessions from previous IAM sessions. If false, only sessions created in the current IAM session are returned. The default is true.</p><br>
12    ///   - [`cluster_identifier(impl Into<String>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::cluster_identifier) / [`set_cluster_identifier(Option<String>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::set_cluster_identifier):<br>required: **false**<br><p>The cluster identifier. Only sessions on this cluster are returned. When providing <code>ClusterIdentifier</code>, then <code>WorkgroupName</code> can't be specified.</p><br>
13    ///   - [`workgroup_name(impl Into<String>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::workgroup_name) / [`set_workgroup_name(Option<String>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::set_workgroup_name):<br>required: **false**<br><p>The serverless workgroup name or Amazon Resource Name (ARN). Only sessions on this workgroup are returned. When providing <code>WorkgroupName</code>, then <code>ClusterIdentifier</code> can't be specified.</p><br>
14    ///   - [`database(impl Into<String>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::database) / [`set_database(Option<String>)`](crate::operation::list_sessions::builders::ListSessionsFluentBuilder::set_database):<br>required: **false**<br><p>The name of the database. Only sessions connected to this database are returned.</p><br>
15    /// - On success, responds with [`ListSessionsOutput`](crate::operation::list_sessions::ListSessionsOutput) with field(s):
16    ///   - [`sessions(Vec::<SessionData>)`](crate::operation::list_sessions::ListSessionsOutput::sessions): <p>The sessions that match the request.</p>
17    ///   - [`next_token(Option<String>)`](crate::operation::list_sessions::ListSessionsOutput::next_token): <p>A value that indicates the starting point for the next set of response records in a subsequent request. If a value is returned in a response, you can retrieve the next set of records by providing this returned NextToken value in the next NextToken parameter and retrying the command. If the NextToken field is empty, all response records have been retrieved for the request.</p>
18    /// - On failure, responds with [`SdkError<ListSessionsError>`](crate::operation::list_sessions::ListSessionsError)
19    pub fn list_sessions(&self) -> crate::operation::list_sessions::builders::ListSessionsFluentBuilder {
20        crate::operation::list_sessions::builders::ListSessionsFluentBuilder::new(self.handle.clone())
21    }
22}