刪除 AgentCore 程式碼解譯器
當您不再需要程式碼解譯器時,您可以將其刪除以釋放資源並避免不必要的費用。
重要
刪除程式碼解譯器會永久移除它及其所有組態。這個動作無法復原。刪除程式碼解譯器之前,請確定所有作用中工作階段都已停止。
範例
- Console
-
-
====== 使用主控台刪除程式碼解譯器
-
在 https://# 開啟 AgentCore 主控台。 https://console.aws.amazon.com/bedrock-agentcore/home
-
在導覽窗格中,選擇內建工具。
-
從程式碼解譯器工具清單中,選取您要刪除的工具。
-
選擇 刪除。
-
在確認對話方塊中,輸入程式碼解譯器的名稱以確認刪除。
-
選擇刪除以永久刪除程式碼解譯器。
-
- AWS CLI
-
-
若要使用 CLI AWS 刪除程式碼解譯器,請使用
delete-code-interpreter命令:aws bedrock-agentcore delete-code-interpreter \ --region <Region> \ --code-interpreter-id "<your-code-interpreter-id>"
-
- Boto3
-
-
若要使用適用於 Python 的 AWS SDK 刪除程式碼解譯器,請使用
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
-
-
若要使用 API 刪除 Code Interpreter 執行個體,請使用下列呼叫:
# 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>
-
列出 AgentCore Code Interpreter 工具
工作階段管理