[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[],[],null,["# Manage application instances\n\nAfter you [build](/vision-ai/docs/build-app) and [deploy](/vision-ai/docs/deploy-app) apps, you can\nmanage these app instances using the Google Cloud console or command line.\n\nView deployed app instances and output\n--------------------------------------\n\nYou can view app instances and output using the Google Cloud console or\ncommand line. You can then use this information to\n[read model output streams](/vision-ai/docs/read-stream)\nand [get assets](/vision-ai/docs/manage-assets-api#get-asset). \n\n### Web UI\n\nView an app's instances and output in the Google Cloud console.\n\n1. Open the **Applications** tab of the Vertex AI Vision dashboard.\n\n [Go to the Applications tab](https://console.cloud.google.com/ai/vision-ai/applications)\n2. Select the name of the app you want to view. This takes you to the\n application details page.\n\n The application details page displays a table with application resources.\n This table lists all the running instances of the application. Each input\n stream to the application has its own instance. Each instance has\n its own input and output resources listed under it.\n\n3. To inspect the stream or warehouse asset resources in the instance table,\n click on the input or output ID, or select the path.\n\n - If you click on **stream** resource, you are redirected to the\n stream details page, where you can inspect the detailed information of\n that stream.\n\n To learn how to read a model's output stream using the command line,\n see [Create and manage Streams](/vision-ai/docs/read-stream).\n\n - Clicking on the **warehouse asset** resource takes you to the\n Vision Warehouse asset details page.\n\n To get a Vision Warehouse asset, see [Manage resources\n using the Vision Warehouse API](/vision-ai/docs/manage-assets-api#get-asset).\n\n### REST\n\nTo list app instances, send a GET request by using the\n[projects.locations.applications.instances.list](/vision-ai/docs/reference/rest/v1/projects.locations.applications.instances/list)\nmethod.\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003ePROJECT\u003c/var\u003e: Your Google Cloud [project ID or\n project number](/resource-manager/docs/creating-managing-projects#identifying_projects).\n- \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e: The [region](/about/locations) where you are using Vertex AI Vision. For example: `us-central1`, `europe-west4`. See [available regions](/vision-ai/docs/warehouse-supported-regions).\n- \u003cvar translate=\"no\"\u003eAPPLICATION_ID\u003c/var\u003e: The ID of your target application.\n\n\nHTTP method and URL:\n\n```\nGET https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID/instances\n```\n\nTo send your request, choose one of these options: \n\n#### curl\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\ncurl -X GET \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n \"https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID/instances\"\n```\n\n#### PowerShell\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nExecute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\" }\n\nInvoke-WebRequest `\n -Method GET `\n -Headers $headers `\n -Uri \"https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID/instances\" | Select-Object -Expand Content\n```\n\nYou should receive a JSON response similar to the following:\n\n```\n{\n \"instances\": [\n {\n \"name\": \"projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID/instances/INSTANCE_ID\",\n \"createTime\": \"2022-03-01T20:05:45.863836157Z\",\n \"inputResources\": [\n {\n \"inputResource\": \"input-stream\",\n \"consumerNode\": \"builtin-input-stream\"\n }\n ],\n \"outputResources\": [\n {\n \"outputResource\": \"sample-resource-1\",\n \"producerNode\": \"builtin-occupancy-count\",\n \"isTemporary\": true\n },\n {\n \"outputResource\": \"sample-resource-2\",\n \"producerNode\": \"builtin-input-stream\"\n },\n {\n \"outputResource\": \"sample-resource-3\",\n \"producerNode\": \"builtin-input-stream\",\n \"isTemporary\": true\n },\n {\n \"outputResource\": \"sample-resource-4\",\n \"producerNode\": \"builtin-input-stream\",\n \"isTemporary\": true\n }\n ]\n }\n ]\n}\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nDelete an app instance\n----------------------\n\n### REST\n\nTo delete application instances, send a POST request by using the\n[projects.locations.applications.deleteApplicationInstances](/vision-ai/docs/reference/rest/v1/projects.locations.applications/deleteApplicationInstances)\nmethod.\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e: Your Google Cloud [project number](/resource-manager/docs/creating-managing-projects#identifying_projects).\n- \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e: The [region](/about/locations) where you are using Vertex AI Vision. For example: `us-central1`, `europe-west4`. See [available regions](/vision-ai/docs/warehouse-supported-regions).\n- \u003cvar translate=\"no\"\u003eAPPLICATION_ID\u003c/var\u003e: The ID of your target application.\n\n\nHTTP method and URL:\n\n```\nPOST https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID:deleteApplicationInstances\n```\n\n\nRequest JSON body:\n\n```\n{\n \"instanceIds\": [\n \"INSTANCE_ID1\",\n \"INSTANCE_ID2\",\n [...]\n ]\n}\n```\n\nTo send your request, choose one of these options: \n\n#### curl\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nSave the request body in a file named `request.json`,\nand execute the following command:\n\n```\ncurl -X POST \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n -d @request.json \\\n \"https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID:deleteApplicationInstances\"\n```\n\n#### PowerShell\n\n| **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\nSave the request body in a file named `request.json`,\nand execute the following command:\n\n```\n$cred = gcloud auth print-access-token\n$headers = @{ \"Authorization\" = \"Bearer $cred\" }\n\nInvoke-WebRequest `\n -Method POST `\n -Headers $headers `\n -ContentType: \"application/json; charset=utf-8\" `\n -InFile request.json `\n -Uri \"https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID:deleteApplicationInstances\" | Select-Object -Expand Content\n```\n\nYou should receive a JSON response similar to the following:\n\n```\n{\n \"name\": \"projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID\",\n \"metadata\": {\n \"@type\": \"type.googleapis.com/google.cloud.visionai.v1.OperationMetadata\",\n \"createTime\": \"[...]\",\n \"Target\": \"projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID\"\n \"Verb\": \"update\"\n \"apiVersion\": \"v1\"\n },\n \"done\": false\n}\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nManage large scale apps\n-----------------------\n\nThe deploy and undeploy methods are valid for applications with less than\n20 instances. If your app has more than 20 instances you must create and\nremove instances incrementally with the API. The recommended workflow is as\nfollows:\n\n1. Create your app.\n2. Add 1-20 experimental instances.\n3. Deploy your application.\n4. Verify your app works as expected.\n5. Use the [`createApplicationInstances`](/vision-ai/docs/reference/rest/v1/projects.locations.applications/createApplicationInstances) method to incrementally add more inputs to the deployed application.\n6. Allow app to run.\n7. Use the [`deleteApplicationInstances`](/vision-ai/docs/reference/rest/v1/projects.locations.applications/deleteApplicationInstances) method to incrementally remove inputs from deployed applications.\n8. Undeploy the application.\n\n| **Caution:** For a single application there can only be *one* update request running at a time. You are responsible for queueing these types of requests, and performing the necessary retries if there is a failure."]]