SignInClient.list_sessions
rboto-signin==0.4.0 · Service index · Types
Model summary (excerpt): Lists sign-in sessions for an IAM identity in your account. If you omit principalArn, the operation lists the caller's own sessions. Specify a user or role ARN to list that identity's sessions, or specify arn:aws:iam::{account-id}:* to list all sessions in the account. Filters are combined with a logical AND.
Install and imports
from rboto import SignInClient
from rboto_signin.types import (
ListSessionsOutput,
SessionStatus,
)
Signature
async def list_sessions(
*,
principal_arn: str | None = None,
max_results: int | None = None,
next_token: str | None = None,
status: SessionStatus | None = None,
client_id: str | None = None,
issued_after: int | None = None,
issued_before: int | None = None,
) -> ListSessionsOutput: ...
Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.
Arguments
| Argument | Required | Model notes (excerpt) |
|---|---|---|
principal_arn |
No | The identity whose sessions to list. Omit to list the caller's own sessions. Specify arn:aws:iam::{account-id}:* to list all sessions in the account. |
max_results |
No | Maximum number of results to return |
next_token |
No | Token for pagination |
status |
No | Returns only sessions with this status |
client_id |
No | Returns only sessions created by this OAuth client |
issued_after |
No | Returns only sessions created at or after this time, in Unix epoch seconds |
issued_before |
No | Returns only sessions created before this time, in Unix epoch seconds |
Output
ListSessionsOutput.
Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.
| Field | Type | Presence | References |
|---|---|---|---|
items |
list[SessionOutput] |
Always present | SessionOutput |
next_token |
str | None |
Always present | — |
| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.
Related types
ListSessionsOutput, SessionStatus
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
client.paginators.list_sessions(...) accepts the same arguments and returns AsyncIterator[ListSessionsOutput]. Direct calls return one page. Pages preserve the Output representation above.
Input cursors: next_token. Page-size argument: max_results.
No output stream.
Errors
Import from rboto_signin.exceptions:
AccessDeniedError, InternalServerError, TooManyRequestsError, ValidationError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.