View a markdown version of this page

删除 AgentCore 代码解释器 - Amazon Bedrock AgentCore

删除 AgentCore 代码解释器

当您不再需要代码解释器时,可以将其删除以释放资源并避免不必要的费用。

重要

删除代码解释器会永久删除该代码解释器及其所有配置。并且无法撤消。在删除代码解释器之前,请确保所有活动会话都已停止。

Console
  1. ====== 使用控制台删除代码解释器

  2. https://console.aws.amazon.com/bedrock-agentcore/home# 处打开 AgentCore 控制台。

  3. 在导航窗格中,选择Built-in 工具

  4. 从代码解释器工具列表中,选择要删除的工具。

  5. 选择删除

  6. 在确认对话框中,输入代码解释器的名称以确认删除。

  7. 选择 “删除” 以永久删除代码解释器。

AWS CLI
  1. 要使用 AWS CLI 删除代码解释器,请使用以下delete-code-interpreter命令:

    aws bedrock-agentcore delete-code-interpreter \ --region <Region> \ --code-interpreter-id "<your-code-interpreter-id>"
Boto3
  1. 要使用适用于 Python 的 AWS 软件开发工具包删除代码解释器,请使用以下delete_code_interpreter方法:

    import boto3 # Initialize the boto3 client cp_client = boto3.client( 'bedrock-agentcore-control', region_name="<Region>", endpoint_url="https://bedrock-agentcore-control.<Region>.amazonaws.com" ) # Delete a Code Interpreter response = cp_client.delete_code_interpreter( codeInterpreterId="<your-code-interpreter-id>" ) print("Code Interpreter deleted successfully")
API
  1. 要使用 API 删除代码解释器实例,请使用以下调用:

    # Using awscurl awscurl -X DELETE "https://bedrock-agentcore-control.<Region>.amazonaws.com/code-interpreters/<your-code-interpreter-id>" \ -H "Accept: application/json" \ --service bedrock-agentcore \ --region <Region>