Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Beberapa metode Video Intelligence API menampilkan operasi yang berjalan lama. Metode ini bersifat asinkron, dan operasi mungkin tidak
diselesaikan saat metode menampilkan respons.
Mendapatkan status operasi
Anda dapat memeriksa status tugas yang berjalan lama (mendeteksi perubahan gambar)
menggunakan nama operasi.
REST
Sebelum menggunakan salah satu data permintaan,
lakukan penggantian berikut:
OPERATION_NAME: kolom name yang ditampilkan
dari panggilan ke Video Intelligence API. Ini adalah nilai dalam format: projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID,
dengan:
PROJECT_NUMBER adalah jumlah
project Google Cloud Anda,
LOCATION_ID adalah region cloud tempat anotasi dilakukan (misalnya: us-east1, us-west1, europe-west1,
asia-east1),
OPERATION_ID adalah ID operasi yang berjalan lama.
Metode HTTP dan URL:
GET https://videointelligence.googleapis.com/v1/OPERATION_NAME
Untuk mengirim permintaan, perluas salah satu opsi berikut:
Anda dapat membatalkan operasi yang berjalan lama menggunakan ID operasi. Namun,
pembatalan tidak dijamin berhasil.
REST
Sebelum menggunakan salah satu data permintaan,
lakukan penggantian berikut:
OPERATION_ID: diberikan dalam respons saat Anda memulai operasi, misalnya
3326639765503758657 dari projects/754177431483/locations/us-west1/operations/3326639765503758657
Catatan:
PROJECT_NUMBER: project ID GCP Anda
LOCATION_ID: region Cloud tempat anotasi
harus dilakukan. Wilayah cloud yang didukung adalah: us-east1, us-west1,
europe-west1, asia-east1. Jika tidak ada region yang ditentukan, region
akan ditentukan berdasarkan lokasi file video.
Metode HTTP dan URL:
POST https://videointelligence.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID:cancel
Untuk mengirim permintaan, perluas salah satu opsi berikut:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-04 UTC."],[],[],null,["# Long-running operations\n\nSome methods of the Video Intelligence API return a long-running\noperation. These methods are asynchronous, and the operation may not be\ncompleted when the method returns a response.\n| **Note:** Video Intelligence API does not support the `PageToken`, or `pageSize` parameters.\n\nGet an operation status\n-----------------------\n\nYou can check the status of a long-running task ([detecting shot changes](/video-intelligence/docs/analyze-shots))\nusing the operation name.\n**Note:** When using the Web UI you can monitor the status in the **Status** column of the list page. \n\n### REST\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003eOPERATION_NAME\u003c/var\u003e: the `name` field returned from the call to Video Intelligence API. This is a value in the format: \n `projects/`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e`/operations/`\u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e, \n where:\n - \u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e is the [number](https://cloud.google.com/resource-manager/docs/creating-managing-projects#identifying_projects) of your Google Cloud project,\n - \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e is the cloud region where annotation took place (for example: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`),\n - \u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e is the ID of the long-running operation.\n\n\nHTTP method and URL:\n\n```\nGET https://videointelligence.googleapis.com/v1/OPERATION_NAME\n```\n\nTo send your request, expand one of these options:\n\n#### curl (Linux, macOS, or Cloud Shell)\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 -H \"x-goog-user-project: PROJECT_NUMBER\" \\\n \"https://videointelligence.googleapis.com/v1/OPERATION_NAME\"\n```\n\n#### PowerShell (Windows)\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\"; \"x-goog-user-project\" = \"PROJECT_NUMBER\" }\n\nInvoke-WebRequest `\n -Method GET `\n -Headers $headers `\n -Uri \"https://videointelligence.googleapis.com/v1/OPERATION_NAME\" | 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.videointelligence.v1p3beta1.AnnotateVideoProgress\",\n \"annotationProgress\": [\n {\n \"inputUri\": \"INPUT_URI\",\n \"progressPercent\": 100,\n \"startTime\": \"2020-05-12T19:36:09.110351Z\",\n \"updateTime\": \"2020-05-12T19:36:17.519069Z\"\n }\n ]\n },\n \"done\": true,\n \"response\": {\n \"@type\": \"type.googleapis.com/google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse\",\n \"annotationResults\": [\n {\n ...\n }\n ]\n }\n}\n```\n\n\u003cbr /\u003e\n\nCancel an operation\n-------------------\n\nYou can cancel a long-running operation using the operation ID. However,\ncancellation is not guaranteed to succeed. \n\n### REST\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e: provided in the response when you started the operation, \n for example `3326639765503758657` from `projects/754177431483/locations/us-west1/operations/3326639765503758657`\n- Note:\n - \u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e: your GCP project ID\n - \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e: 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.\n\n\nHTTP method and URL:\n\n```\nPOST https://videointelligence.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID:cancel\n```\n\nTo send your request, expand one of these options:\n\n#### curl (Linux, macOS, or Cloud Shell)\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 POST \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"x-goog-user-project: PROJECT_NUMBER\" \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n -d \"\" \\\n \"https://videointelligence.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID:cancel\"\n```\n\n#### PowerShell (Windows)\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\"; \"x-goog-user-project\" = \"PROJECT_NUMBER\" }\n\nInvoke-WebRequest `\n -Method POST `\n -Headers $headers `\n -Uri \"https://videointelligence.googleapis.com/v1/projects/PROJECT_NUMBER/locations/LOCATION_ID/operations/OPERATION_ID:cancel\" | Select-Object -Expand Content\n```\n\nYou should receive a successful status code (2xx) and an empty response.\n\n\u003cbr /\u003e"]]