AWS Systems Manager
API Reference (API Version 2014-11-06)

DescribeSessions

Retrieves a list of all active sessions (both connected and disconnected) or terminated sessions from the past 30 days.

Request Syntax

{ "Filters": [ { "key": "string", "value": "string" } ], "MaxResults": number, "NextToken": "string", "State": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Filters

One or more filters to limit the type of sessions returned by the request.

Type: Array of SessionFilter objects

Array Members: Minimum number of 1 item. Maximum number of 5 items.

Required: No

MaxResults

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 200.

Required: No

NextToken

The token for the next set of items to return. (You received this token from a previous call.)

Type: String

Required: No

State

The session status to retrieve a list of sessions for. For example, "Active".

Type: String

Valid Values: Active | History

Required: Yes

Response Syntax

{ "NextToken": "string", "Sessions": [ { "Details": "string", "DocumentName": "string", "EndDate": number, "OutputUrl": { "CloudWatchOutputUrl": "string", "S3OutputUrl": "string" }, "Owner": "string", "SessionId": "string", "StartDate": number, "Status": "string", "Target": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

NextToken

The token for the next set of items to return. (You received this token from a previous call.)

Type: String

Sessions

A list of sessions meeting the request parameters.

Type: Array of Session objects

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServerError

An error occurred on the server side.

HTTP Status Code: 500

InvalidFilterKey

The specified key is not valid.

HTTP Status Code: 400

InvalidNextToken

The specified token is not valid.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: