管理已部署的应用

您可以列出 ReasoningEngine 实例、获取 ReasoningEngine 实例或删除 ReasoningEngine 实例。

列出 ReasoningEngine 实例

Python 版 Vertex AI SDK

以下命令会列出给定项目和位置的所有 ReasoningEngine 实例:

reasoning_engines.ReasoningEngine.list()

以下代码按 display_name 过滤 ReasoningEngine 实例的列表:

reasoning_engines.ReasoningEngine.list(filter='display_name="DISPLAY_NAME"')

例如:py reasoning_engines.ReasoningEngine.list(filter='display_name="Demo Langchain Application"')

REST

执行以下 curl 命令可列出给定项目和位置的所有 ReasoningEngine 实例:

curl \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://LOCATION-aiplatform.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/reasoningEngines

获取 ReasoningEngine 实例

每个 ReasoningEngine 实例都有一个唯一的 RESOURCE_ID 标识符。如需了解详情,请参阅部署应用

Python 版 Vertex AI SDK

通过以下代码,您可以获取特定 ReasoningEngine 资源:

remote_app = reasoning_engines.ReasoningEngine("RESOURCE_ID")

或者,您也可以提供完整资源名称:

remote_app = reasoning_engines.ReasoningEngine(
"projects/PROJECT_ID/locations/LOCATION/reasoningEngines/RESOURCE_ID"
)

REST

执行以下 curl 命令可获取特定 ReasoningEngine 资源:

curl \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://LOCATION-aiplatform.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/reasoningEngines/RESOURCE_ID

删除 ReasoningEngine 实例

Python 版 Vertex AI SDK

通过以下代码,您可以删除设置为 remote_app 变量的 ReasoningEngine 实例:

remote_app.delete()

REST

每个 ReasoningEngine 实例都有一个唯一的 RESOURCE_ID 标识符。如需了解详情,请参阅部署应用

执行以下 curl 命令可删除特定 ReasoningEngine 实例:

curl \
-X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://LOCATION-aiplatform.googleapis.com/v1beta1/projects/PROJECT_ID/locations/LOCATION/reasoningEngines/RESOURCE_ID