

# SessionData
<a name="API_SessionData"></a>

Contains the metadata for a session returned by `ListSessions`, including its status, compute target, database connection, and lifecycle timestamps.

## Contents
<a name="API_SessionData_Contents"></a>

**Note**  
In the following list, the required parameters are described first.

 ** CreatedAt **   <a name="redshiftdata-Type-SessionData-CreatedAt"></a>
The date and time (UTC) when the session was created.  
Type: Timestamp  
Required: Yes

 ** SessionId **   <a name="redshiftdata-Type-SessionData-SessionId"></a>
The session identifier. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API.  
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d{0,2})?`   
Required: Yes

 ** Status **   <a name="redshiftdata-Type-SessionData-Status"></a>
The status of the session. Status values are defined as follows:  
+ AVAILABLE – The session is open and ready to run a SQL statement.
+ BUSY – The session is currently running a SQL statement.
+ CLOSED – The session is closed and can no longer run SQL statements.
Type: String  
Valid Values: `AVAILABLE | BUSY | CLOSED`   
Required: Yes

 ** ClusterIdentifier **   <a name="redshiftdata-Type-SessionData-ClusterIdentifier"></a>
The cluster identifier. This element is not returned when connecting to a serverless workgroup.  
Type: String  
Required: No

 ** CurrentStatementId **   <a name="redshiftdata-Type-SessionData-CurrentStatementId"></a>
The identifier of the SQL statement currently running in the session. This value is a universally unique identifier (UUID) generated by Amazon Redshift Data API. This element is returned only when the session status is `BUSY`.  
Type: String  
Pattern: `[a-z0-9]{8}(-[a-z0-9]{4}){3}-[a-z0-9]{12}(:\d{0,2})?`   
Required: No

 ** Database **   <a name="redshiftdata-Type-SessionData-Database"></a>
The name of the database that the session is connected to.  
Type: String  
Required: No

 ** DbUser **   <a name="redshiftdata-Type-SessionData-DbUser"></a>
The database user name.  
Type: String  
Required: No

 ** SessionAliveSeconds **   <a name="redshiftdata-Type-SessionData-SessionAliveSeconds"></a>
The number of seconds that the session is kept alive after a query finishes.  
Type: Integer  
Valid Range: Minimum value of 0. Maximum value of 86400.  
Required: No

 ** SessionTtl **   <a name="redshiftdata-Type-SessionData-SessionTtl"></a>
The date and time (UTC) when the session is set to expire and be closed.  
Type: Timestamp  
Required: No

 ** UpdatedAt **   <a name="redshiftdata-Type-SessionData-UpdatedAt"></a>
The date and time (UTC) that the session metadata was last updated. An example is the time the status last changed.  
Type: Timestamp  
Required: No

 ** WorkgroupName **   <a name="redshiftdata-Type-SessionData-WorkgroupName"></a>
The serverless workgroup name or Amazon Resource Name (ARN). This element is not returned when connecting to a provisioned cluster.  
Type: String  
Length Constraints: Minimum length of 3. Maximum length of 128.  
Pattern: `([a-z0-9-]{3,63}|arn:(aws(-[a-z]+)*):redshift-serverless:([a-z]{2}(-gov|(-iso[a-z]?))?|eusc-[a-z]+)-[a-z]+-\d{1}:\d{12}:workgroup/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})`   
Required: No

## See Also
<a name="API_SessionData_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS SDK for C\+\+](https://docs.aws.amazon.com/goto/SdkForCpp/redshift-data-2019-12-20/SessionData) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/redshift-data-2019-12-20/SessionData) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/redshift-data-2019-12-20/SessionData) 