Create and update a Streaming video warehouse

A Vision Warehouse is a component you can add to your app to store model output and streaming data.

Create a streaming video warehouse

To connect other component nodes of your app graph to a warehouse you must first create a streaming video warehouse.

Console

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

    Go to the Warehouses tab

  2. Select Create.

  3. Add a name for the warehouse and choose a time to live (TTL) period for assets stored in the warehouse. These values can be modified later.

    After a warehouse is created you can add the warehouse to an application graph.

REST & CMD LINE

Creates a new corpus resource under the given project with the option to specify the corpus display name, description and a TTL.

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.
  • DISPLAY_NAME: Display name for the warehouse.
  • WAREHOUSE_DESCRIPTION: The description of the warehouse (corpus).
  • TIME_TO_LIVE: The amount of time to live (TTL) for all assets under a corpus, or the TTL of a specific asset. For example, for a corpus with assets with a TTL of 100 days, provide the value 8640000 (seconds).

HTTP method and URL:

POST https://warehouse-visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/corpora

Request JSON body:

{
  "display_name": "DISPLAY_NAME",
  "description": "WAREHOUSE_DESCRIPTION",
  "type": "STREAM_VIDEO",
  "default_ttl": {
    "seconds": TIME_TO_LIVE
  }
}

To send your request, choose one of these options:

curl

Save the request body in a file named request.json, and execute the following command:

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

PowerShell

Save the request body in a file named request.json, and execute the following command:

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

Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://warehouse-visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/corpora" | Select-Object -Expand Content

You should receive a JSON response similar to the following:

{
  "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/warehouseoperations/OPERATION_ID",
  "metadata": {
    "@type": "type.googleapis.com/google.cloud.visionai.v1.CreateCorpusMetadata"
  },
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.cloud.visionai.v1.Corpus",
    "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/corpora/CORPUS_ID",
    "displayName": "DISPLAY_NAME",
    "description": "WAREHOUSE_DESCRIPTION",
    "type": "STREAM_VIDEO",
    "defaultTtl": "TIME_TO_LIVE"
  }
}

Update a streaming video warehouse

Updates an existing corpus under the given project with the option to update display name, description, default TTL, or update all available fields.

REST & CMD LINE

Updates an existing corpus resource under the given project. This sample shows you how to update the corpus display name, but you can also update description, TTL, or all fields at once using the same URL format and updated request body.

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.
  • CORPUS_ID: The ID of your target corpus.
  • ?updateMask=fieldToUpdate: One of the available fields you can apply an updateMask to. Specify the corresponding new field value in the request body. This new value replaces the existing field value. Available fields:
    • Display name: ?updateMask=display_name
    • Description: ?updateMask=description
    • Default time-to-live (TTL): ?updateMask=default_ttl
    • Update all fields: ?updateMask=*
  • UPDATED_FIELD_VALUE: A new value for the specified field. In this example, a new user-provided display name for the warehouse resource.

HTTP method and URL:

PATCH https://warehouse-visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/corpora/CORPUS_ID?update_mask=display_name

Request JSON body:

{
  "displayName": "UPDATED_FIELD_VALUE",
  "description": "Original description",
  "defaultTtl": {
    "seconds": "7800"
  }
}

To send your request, choose one of these options:

curl

Save the request body in a file named request.json, and execute the following command:

curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://warehouse-visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/corpora/CORPUS_ID?update_mask=display_name"

PowerShell

Save the request body in a file named request.json, and execute the following command:

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

Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://warehouse-visionai.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/corpora/CORPUS_ID?update_mask=display_name" | Select-Object -Expand Content

You should receive a JSON response similar to the following:

{
  "name": "projects/PROJECT_ID/locations/LOCATION_ID/corpora/CORPORA_ID",
  "displayName": "UPDATED_FIELD_VALUE",
  "description": "Original description",
  "defaultTtl": "7800s"
}