Deploy and undeploy an application

After you create an app you must deploy the app to be able to stream and analyze data.

Deploy an application

After you have built an end-to-end application with all the necessary components, you must deploy the app to start using it.

Console

  1. Open the Applications tab of the Vertex AI Vision dashboard.

    Go to the Applications tab

  2. Select View app next to the name of your application from the list.

  3. From the application graph builder page click the Deploy button.

  4. In the Deploy application menu that opens, select any options and click Deploy.

    After deployment completes there will be green check marks next to the nodes.

REST & CMD LINE

To deploy your application for use, send a POST request using the projects.locations.applications.deploy method.

Before using any of the request data, make the following replacements:

HTTP method and URL:

POST https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID:deploy

To send your request, choose one of these options:

curl

Execute the following command:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d "" \
"https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID:deploy"

PowerShell

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-Uri "https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID:deploy" | Select-Object -Expand Content
If successful, the request starts a long-running operation and returns a JSON object with the operation ID.
{
  "name": "projects/PROJECT_ID/locations/LOCATION_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.visionai.v1.OperationMetadata",
    "createTime": "YYYY-MM-DDTHH:MM:SS.454506987Z",
    "target": "projects/PROJECT_ID/locations/LOCATION_ID/applications/APPLICATION_ID",
    "verb": "update",
    "requestedCancellation": false,
    "apiVersion": "v1"
  },
  "done": false
}

Get operation status

Use the operation ID in the response to get the status of the deploy request.

Before using any of the request data, make the following replacements:

  • REGIONALIZED_ENDPOINT: Endpoint might include a prefix matching the LOCATION_ID such as europe-west4-. See more about regionalized endpoints.
  • PROJECT_NUMBER: Your Google Cloud project number.
  • LOCATION_ID: The region where you are using Vertex AI Vision. For example: us-central1, europe-west4. See available regions.
  • OPERATION_ID: The operation ID that is returned when you start a long-running operation. For example:
    • projects/123456/locations/us-central1/[...]/operations/OPERATION_ID

HTTP method and URL:

GET https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID

To send your request, choose one of these options:

curl

Execute the following command:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID"

PowerShell

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID" | Select-Object -Expand Content

You should receive a JSON response similar to the following:

Undeploy an application

To stop using an app, you must undeploy the application.

Console

  1. Open the Applications tab of the Vertex AI Vision dashboard.

    Go to the Applications tab

  2. Select View app next to the name of your application from the list.

  3. From the application graph builder page click the Deactivate button.

REST & CMD LINE

To undeploy your application, send a POST request using the projects.locations.applications.undeploy method.

Before using any of the request data, make the following replacements:

HTTP method and URL:

POST https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID:undeploy

To send your request, choose one of these options:

curl

Execute the following command:

curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d "" \
"https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID:undeploy"

PowerShell

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-Uri "https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_ID:undeploy" | Select-Object -Expand Content
If successful, the request starts a long-running operation and returns a JSON object with the operation ID.
{
  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.visionai.v1.OperationMetadata",
    "createTime": "2023-01-12T18:14:48.260296926Z",
    "target": "projects/PROJECT_NUMBER/locations/LOCATION_ID/applications/APPLICATION_NAME",
    "verb": "update",
    "requestedCancellation": false,
    "apiVersion": "v1"
  },
  "done": false
}

Get operation status

Use the operation ID in the response to get the status of the undeploy request.

Before using any of the request data, make the following replacements:

  • REGIONALIZED_ENDPOINT: Endpoint might include a prefix matching the LOCATION_ID such as europe-west4-. See more about regionalized endpoints.
  • PROJECT_NUMBER: Your Google Cloud project number.
  • LOCATION_ID: The region where you are using Vertex AI Vision. For example: us-central1, europe-west4. See available regions.
  • OPERATION_ID: The operation ID that is returned when you start a long-running operation. For example:
    • projects/123456/locations/us-central1/[...]/operations/OPERATION_ID

HTTP method and URL:

GET https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID

To send your request, choose one of these options:

curl

Execute the following command:

curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID"

PowerShell

Execute the following command:

$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }

Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID" | Select-Object -Expand Content

You should receive a JSON response similar to the following:

What's next