stop_runtime_session
¶
stop_runtime_session(
runtime_session_id: SessionType,
agent_runtime_arn: str,
*,
config_overrides: Optional[BedrockAgentCoreClientConfig] = None,
qualifier: Optional[str] = None,
client_token: Optional[ClientToken] = None,
) -> StopRuntimeSessionResponse
Stops a session that is running in an running AgentCore Runtime agent.
Parameters:
-
runtime_session_id(SessionType) –The ID of the session that you want to stop.
-
agent_runtime_arn(str) –The ARN of the agent that contains the session that you want to stop.
-
qualifier(Optional[str], default:None) –Optional qualifier to specify an agent alias, such as
prodcode> ordev. If you don't provide a value, the DEFAULT alias is used. -
client_token(Optional[ClientToken], default:None) –Idempotent token used to identify the request. If you use the same token with multiple requests, the same response is returned. Use ClientToken to prevent the same request from being processed more than once.
Raises:
-
AccessDeniedException–The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.
-
ConflictException–The exception that occurs when the request conflicts with the current state of the resource. This can happen when trying to modify a resource that is currently being modified by another request, or when trying to create a resource that already exists.
-
InternalServerException–The exception that occurs when the service encounters an unexpected internal error. This is a temporary condition that will resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.
-
ResourceNotFoundException–The exception that occurs when the specified resource does not exist. This can happen when using an invalid identifier or when trying to access a resource that has been deleted.
-
RetryableConflictException–The exception that occurs when there is a retryable conflict performing an operation. This is a temporary condition that may resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.
-
RuntimeClientError–The exception that occurs when there is an error in the runtime client. This can happen due to network issues, invalid configuration, or other client-side problems. Check the error message for specific details about the error.
-
ServiceQuotaExceededException–The exception that occurs when the request would cause a service quota to be exceeded. Review your service quotas and either reduce your request rate or request a quota increase.
-
ThrottlingException–The exception that occurs when the request was denied due to request throttling. This happens when you exceed the allowed request rate for an operation. Reduce the frequency of requests or implement exponential backoff retry logic in your application.
-
UnauthorizedException–This exception is thrown when the JWT bearer token is invalid or not found for OAuth bearer token based access
-
ValidationException–The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agentcore/_services/bedrock_agent_core.py
1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 | |