Stay organized with collections
Save and categorize content based on your preferences.
For some API calls, Vertex AI returns operation names. These API calls
start operations that require time to complete and are known as long-running
operations. For example, creating a dataset, deleting an endpoint, or exporting
a model are all long-running operations. You can use helper methods along with
operation names to get the status of or cancel a long-running operation, as
described in the following sections.
Getting the status of an operation
To get the operation status, use the operation name that was in the response
when you requested a long-running operation. For example, when you create a
dataset, Vertex AI returns an operation name such as: projects/PROJECT_NUMBER/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID
You can poll the operation at regular intervals so that you know when an
operation completes.
REST
Before using any of the request data,
make the following replacements:
OPERATION_NAME: The operation name that is returned when you
start a long-running operation, such as
projects/PROJECT_NUMBER/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID
HTTP method and URL:
GET https://LOCATION-aiplatform.googleapis.com/v1/OPERATION_NAME
To send your request, choose one of these options:
In the output, the metadata object contains information that is
specific to the request type. The done field indicates whether the
operation is complete. If the operation is complete, the response
object contains results from the operation.
You can cancel a long-running operation so that you can stop it before the
operation completes. When you successfully cancel an operation, the operation
isn't deleted; instead, the operation stops with an error code of 1 and
with a CANCELLED message. Note that the cancellation is not guaranteed to
succeed.
REST
Before using any of the request data,
make the following replacements:
OPERATION_NAME: The operation name that is returned when you
start a long-running operation, such as
projects/PROJECT_NUMBER/locations/LOCATION/datasets/DATASET_ID/operations/OPERATION_ID
HTTP method and URL:
POST https://LOCATION-aiplatform.googleapis.com/v1/OPERATION_NAME:cancel
To send your request, choose one of these options:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-26 UTC."],[],[],null,["For some API calls, Vertex AI returns operation names. These API calls\nstart operations that require time to complete and are known as *long-running\noperations*. For example, creating a dataset, deleting an endpoint, or exporting\na model are all long-running operations. You can use helper methods along with\noperation names to get the status of or cancel a long-running operation, as\ndescribed in the following sections.\n| **Note:** If you are using the Google Cloud console, the console shows the status of the operation and automatically updates the status when an operation is complete.\n\nGetting the status of an operation\n\nTo get the operation status, use the operation name that was in the response\nwhen you requested a long-running operation. For example, when you create a\ndataset, Vertex AI returns an operation name such as: \n\n`projects/`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e`/datasets/`\u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e`/operations/`\u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e\n\nYou can poll the operation at regular intervals so that you know when an\noperation completes. \n\nREST\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003eOPERATION_NAME\u003c/var\u003e: The operation name that is returned when you start a long-running operation, such as `projects/`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e`/datasets/`\u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e`/operations/`\u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e\n\n\nHTTP method and URL:\n\n```\nGET https://LOCATION-aiplatform.googleapis.com/v1/OPERATION_NAME\n```\n\nTo send your request, choose one of these options: \n\ncurl **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://LOCATION-aiplatform.googleapis.com/v1/OPERATION_NAME\"\n```\n\nPowerShell **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://LOCATION-aiplatform.googleapis.com/v1/OPERATION_NAME\" | Select-Object -Expand Content\n```\n\nIn the output, the `metadata` object contains information that is\nspecific to the request type. The `done` field indicates whether the\noperation is complete. If the operation is complete, the `response`\nobject contains results from the operation.\n\n```\n{\n \"name\": \"projects/123456789012/locations/us-central1/datasets/1234567890123456789/operations/1223344556677889900\",\n \"metadata\": {\n \"@type\": \"type.googleapis.com/google.cloud.aiplatform.v1.CreateDatasetOperationMetadata\",\n \"genericMetadata\": {\n \"createTime\": \"2020-10-12T16:00:44.686500Z\",\n \"updateTime\": \"2020-10-12T16:01:06.115081Z\"\n }\n },\n \"done\": true,\n \"response\": {\n \"@type\": \"type.googleapis.com/google.cloud.aiplatform.v1.Dataset\",\n \"name\": \"projects/123456789012/locations/us-central1/datasets/1234567890123456789\",\n \"displayName\": \"image_dataset\",\n \"metadataSchemaUri\": \"gs://google-cloud-aiplatform/schema/dataset/metadata/image_1.0.0.yaml\",\n \"labels\": {\n \"aiplatform.googleapis.com/dataset_metadata_schema\": \"IMAGE\"\n },\n \"metadata\": {\n \"dataItemSchemaUri\": \"gs://google-cloud-aiplatform/schema/dataset/dataitem/image_1.0.0.yaml\"\n }\n }\n}\n```\n\n\u003cbr /\u003e\n\nCanceling an Operation\n\nYou can cancel a long-running operation so that you can stop it before the\noperation completes. When you successfully cancel an operation, the operation\nisn't deleted; instead, the operation stops with an error code of `1` and\nwith a `CANCELLED` message. Note that the cancellation is not guaranteed to\nsucceed. \n\nREST\n\n\nBefore using any of the request data,\nmake the following replacements:\n\n- \u003cvar translate=\"no\"\u003eOPERATION_NAME\u003c/var\u003e: The operation name that is returned when you start a long-running operation, such as `projects/`\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`/locations/`\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e`/datasets/`\u003cvar translate=\"no\"\u003eDATASET_ID\u003c/var\u003e`/operations/`\u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e\n\n\nHTTP method and URL:\n\n```\nPOST https://LOCATION-aiplatform.googleapis.com/v1/OPERATION_NAME:cancel\n```\n\nTo send your request, choose one of these options: \n\ncurl **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 \"Content-Type: application/json; charset=utf-8\" \\\n -d \"\" \\\n \"https://LOCATION-aiplatform.googleapis.com/v1/OPERATION_NAME:cancel\"\n```\n\nPowerShell **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 POST `\n -Headers $headers `\n -Uri \"https://LOCATION-aiplatform.googleapis.com/v1/OPERATION_NAME:cancel\" | Select-Object -Expand Content\n```\n\nYou should receive a successful status code (2xx) and an empty response.\n\n\u003cbr /\u003e"]]