Skip to content

stop_code_interpreter_session

Operation

stop_code_interpreter_session

stop_code_interpreter_session(request: StopCodeInterpreterSessionInput | StopCodeInterpreterSessionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[StopCodeInterpreterSessionInputDict]) -> StopCodeInterpreterSessionOutput

Terminates an active code interpreter session in Amazon Bedrock AgentCore. This operation stops the session, releases associated resources, and makes the session unavailable for further use.

To stop a code interpreter session, you must specify both the code interpreter identifier and the session ID. Once stopped, a session cannot be restarted; you must create a new session using StartCodeInterpreterSession.

The following operations are related to StopCodeInterpreterSession:

Parameters:

Name Type Description Default
request StopCodeInterpreterSessionInput | StopCodeInterpreterSessionInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[StopCodeInterpreterSessionInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
StopCodeInterpreterSessionOutput

An instance of StopCodeInterpreterSessionOutput.

stop_code_interpreter_session async

stop_code_interpreter_session(request: StopCodeInterpreterSessionInput | StopCodeInterpreterSessionInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[StopCodeInterpreterSessionInputDict]) -> StopCodeInterpreterSessionOutput

Terminates an active code interpreter session in Amazon Bedrock AgentCore. This operation stops the session, releases associated resources, and makes the session unavailable for further use.

To stop a code interpreter session, you must specify both the code interpreter identifier and the session ID. Once stopped, a session cannot be restarted; you must create a new session using StartCodeInterpreterSession.

The following operations are related to StopCodeInterpreterSession:

Parameters:

Name Type Description Default
request StopCodeInterpreterSessionInput | StopCodeInterpreterSessionInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[StopCodeInterpreterSessionInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
StopCodeInterpreterSessionOutput

An instance of StopCodeInterpreterSessionOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

StopCodeInterpreterSessionInputDict

Bases: TypedDict

Dictionary form of StopCodeInterpreterSessionInput.

Attributes

client_token instance-attribute
client_token: str | None

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock AgentCore ignores the request, but does not return an error.

This field is autopopulated if not provided.

code_interpreter_identifier instance-attribute
code_interpreter_identifier: Required[str]

The unique identifier of the code interpreter associated with the session.

session_id instance-attribute
session_id: Required[str]

The unique identifier of the code interpreter session to stop.

trace_id instance-attribute
trace_id: str | None

The trace identifier for request tracking.

trace_parent instance-attribute
trace_parent: str | None

The parent trace information for distributed tracing.

StopCodeInterpreterSessionInput dataclass

Bases: _SerdeShape

Dataclass for StopCodeInterpreterSessionInput structure.

Attributes

client_token class-attribute instance-attribute
client_token: str | None = ...

A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock AgentCore ignores the request, but does not return an error.

This field is autopopulated if not provided.

code_interpreter_identifier class-attribute instance-attribute
code_interpreter_identifier: str | None = ...

The unique identifier of the code interpreter associated with the session.

session_id class-attribute instance-attribute
session_id: str | None = ...

The unique identifier of the code interpreter session to stop.

trace_id class-attribute instance-attribute
trace_id: str | None = ...

The trace identifier for request tracking.

trace_parent class-attribute instance-attribute
trace_parent: str | None = ...

The parent trace information for distributed tracing.

Output

StopCodeInterpreterSessionOutput dataclass

Bases: _SerdeShape

Dataclass for StopCodeInterpreterSessionOutput structure.

Attributes

code_interpreter_identifier instance-attribute
code_interpreter_identifier: str

The identifier of the code interpreter.

last_updated_at instance-attribute
last_updated_at: datetime

The timestamp when the code interpreter session was last updated.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.

session_id instance-attribute
session_id: str

The identifier of the code interpreter session.