BedrockAgentCoreDataPlaneFrontingLayer / Client / list_code_interpreter_sessions

list_code_interpreter_sessions

BedrockAgentCoreDataPlaneFrontingLayer.Client.list_code_interpreter_sessions(**kwargs)

Retrieves a list of code interpreter sessions in Amazon Bedrock that match the specified criteria. This operation returns summary information about each session, including identifiers, status, and timestamps.

You can filter the results by code interpreter identifier and session status. The operation supports pagination to handle large result sets efficiently.

We recommend using pagination to ensure that the operation returns quickly and successfully when retrieving large numbers of sessions.

The following operations are related to ListCodeInterpreterSessions:

See also: AWS API Documentation

Request Syntax

response = client.list_code_interpreter_sessions(
    codeInterpreterIdentifier='string',
    maxResults=123,
    nextToken='string',
    status='READY'|'TERMINATED'
)
Parameters:
  • codeInterpreterIdentifier (string) –

    [REQUIRED]

    The unique identifier of the code interpreter to list sessions for. If specified, only sessions for this code interpreter are returned. If not specified, sessions for all code interpreters are returned.

  • maxResults (integer) – The maximum number of results to return in a single call. The default value is 10. Valid values range from 1 to 100. To retrieve the remaining results, make another call with the returned nextToken value.

  • nextToken (string) – The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results. If not specified, Amazon Bedrock returns the first page of results.

  • status (string) – The status of the code interpreter sessions to list. Valid values include ACTIVE, STOPPING, and STOPPED. If not specified, sessions with any status are returned.

Return type:

dict

Returns:

Response Syntax

{
    'items': [
        {
            'codeInterpreterIdentifier': 'string',
            'sessionId': 'string',
            'name': 'string',
            'status': 'READY'|'TERMINATED',
            'createdAt': datetime(2015, 1, 1),
            'lastUpdatedAt': datetime(2015, 1, 1)
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • items (list) –

      The list of code interpreter sessions that match the specified criteria.

      • (dict) –

        A condensed representation of a code interpreter session in Amazon Bedrock. This structure contains key information about a code interpreter session, including identifiers, status, and timestamps, without the full details of the session configuration.

        • codeInterpreterIdentifier (string) –

          The unique identifier of the code interpreter associated with the session. This identifier specifies which code interpreter environment is used for the session.

        • sessionId (string) –

          The unique identifier of the code interpreter session. This identifier is used in operations that interact with the session.

        • name (string) –

          The name of the code interpreter session. This name helps identify and manage the session.

        • status (string) –

          The current status of the code interpreter session. Possible values include ACTIVE, STOPPING, and STOPPED.

        • createdAt (datetime) –

          The timestamp when the code interpreter session was created. This value is in ISO 8601 format.

        • lastUpdatedAt (datetime) –

          The timestamp when the code interpreter session was last updated. This value is in ISO 8601 format.

    • nextToken (string) –

      The token to use in a subsequent ListCodeInterpreterSessions request to get the next set of results.

Exceptions

  • BedrockAgentCoreDataPlaneFrontingLayer.Client.exceptions.AccessDeniedException

  • BedrockAgentCoreDataPlaneFrontingLayer.Client.exceptions.ValidationException

  • BedrockAgentCoreDataPlaneFrontingLayer.Client.exceptions.ResourceNotFoundException

  • BedrockAgentCoreDataPlaneFrontingLayer.Client.exceptions.ThrottlingException

  • BedrockAgentCoreDataPlaneFrontingLayer.Client.exceptions.InternalServerException