This legacy version of Video Intelligence API is deprecated and
will no longer be available on Google Cloud after January 23, 2024. All the
functionality of Video Intelligence API and new features are available on the Vertex
AI platform. See Migrate
to Vertex AI to learn how to migrate your resources.
This product or feature is covered by the
Pre-GA Offerings Terms of the
Google Cloud Terms of Service.
Pre-GA products and features might have limited support, and changes to pre-GA products and
features might not be compatible with other pre-GA versions.
For more information, see the
launch stage descriptions .
Some methods of AutoML Video Intelligence return a long-running
operation. These methods are asynchronous, and the operation may not be
completed when the method returns a response.
Get an operation status
You can check the status of a long-running task (importing items into a dataset or training a model )
using the operation name.
Note: When using the Web UI you can monitor the status in the Status column
of the list page. Note: You can only check the status of operations using the AutoML API.
REST
Before using any of the request data,
make the following replacements:
project-number : your project number
location-id : for example, us-central1
operation id : provided in the response when you started the operation, for example
for Classification: VCN123....
, and for Object tracking: VOT123....
HTTP method and URL:
GET https://automl.googleapis.com/v1beta1/projects/project-number /locations/location-id /operations/operation-id
To send your request, choose one of these options:
curl
Note:
The following command assumes that you have logged in to
the gcloud
CLI with your user account by executing
gcloud init
or
gcloud auth login
,
or by using
Cloud Shell ,
which automatically logs you into the gcloud
CLI.
You can check the currently active account by executing
gcloud auth list
.
Execute the following command:
curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "x-goog-user-project: project-number " \ "https://automl.googleapis.com/v1beta1/projects/project-number /locations/location-id /operations/operation-id "
PowerShell
Note:
The following command assumes that you have logged in to
the gcloud
CLI with your user account by executing
gcloud init
or
gcloud auth login
,
or by using
Cloud Shell ,
which automatically logs you into the gcloud
CLI.
You can check the currently active account by executing
gcloud auth list
.
Execute the following command:
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred"; "x-goog-user-project" = "project-number " } Invoke-WebRequest ` -Method GET ` -Headers $headers ` -Uri "https://automl.googleapis.com/v1beta1/projects/project-number /locations/location-id /operations/operation-id " | Select-Object -Expand Content
The model-id is the ID of your model, from the response when you created the model.
The ID is the last element of the name of your model. For example:
model name: projects/project-number /locations/location-id /models/model-id
model id: model-id
Response
{
"name": "projects/project-number /locations/us-central1/operations/operation-id ",
"metadata": {
"@type": "type.googleapis.com/google.cloud.automl.v1beta1.OperationMetadata",
"progressPercentage": 100,
"createTime": "2020-02-27T01:56:28.395640Z",
"updateTime": "2020-02-27T02:04:12.336070Z"
},
"done": true,
"response": {
"@type": "type.googleapis.com/google.cloud.automl.v1beta1.Model",
"name": "projects/project-number /locations/us-central1/models/model-id ",
"createTime": "2020-02-27T02:00:22.329970Z",
"videoClassificationModelMetadata": {
"base_model" : ""
},
"displayName": "a_98487760535e48319dd204e6394670"
}
}
Cancel an operation
You can cancel a long-running operation using the operation ID. The
cancellation is not guaranteed to succeed.
REST
Before using any of the request data,
make the following replacements:
operation id : provided in the response when you started the operation, for example
for Classification: VCN123....
, and for Object tracking: VOT123....
Note:
project-number : your GCP project ID
location-id : the Cloud region where annotation
should take place. Supported cloud regions are: us-east1
, us-west1
,
europe-west1
, asia-east1
. If no region is specified, a region
will be determined based on video file location.
HTTP method and URL:
POST https://automl.googleapis.com/v1beta1/projects/project-number /locations/location-id /operations/operation-id :cancel
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Note:
The following command assumes that you have logged in to
the gcloud
CLI with your user account by executing
gcloud init
or
gcloud auth login
,
or by using
Cloud Shell ,
which automatically logs you into the gcloud
CLI.
You can check the currently active account by executing
gcloud auth list
.
Execute the following command:
curl -X POST \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "x-goog-user-project: project-number " \ -H "Content-Type: application/json; charset=utf-8" \ -d "" \ "https://automl.googleapis.com/v1beta1/projects/project-number /locations/location-id /operations/operation-id :cancel"
PowerShell (Windows)
Note:
The following command assumes that you have logged in to
the gcloud
CLI with your user account by executing
gcloud init
or
gcloud auth login
,
or by using
Cloud Shell ,
which automatically logs you into the gcloud
CLI.
You can check the currently active account by executing
gcloud auth list
.
Execute the following command:
$cred = gcloud auth print-access-token $headers = @{ "Authorization" = "Bearer $cred"; "x-goog-user-project" = "project-number " } Invoke-WebRequest ` -Method POST ` -Headers $headers ` -Uri "https://automl.googleapis.com/v1beta1/projects/project-number /locations/location-id /operations/operation-id :cancel" | Select-Object -Expand Content
You should receive a successful status code (2xx) and an empty response.