Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page explique comment lister toutes les opérations de longue durée et afficher l'état d'une opération de longue durée.
Pour vérifier l'état et afficher d'autres informations d'erreur d'une opération de longue durée, vous devez d'abord obtenir la valeur de OPERATION_NAME, puis demander l'état.
ListOperations
Pour répertorier toutes les opérations de longue durée, envoyez la requête suivante:
Lorsque vous envoyez une requête et que vous recevez une réponse, par exemple de CreateBlockchainNode ou de DeleteBlockchainNode, la réponse inclut OPERATION_ID:
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/04 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/04 (UTC)."],[[["\u003cp\u003eThis guide provides instructions on how to list all long-running operations within your project and view their status.\u003c/p\u003e\n"],["\u003cp\u003eTo list all operations, you can send a \u003ccode\u003eListOperations\u003c/code\u003e request to the specified endpoint, providing your project ID and location.\u003c/p\u003e\n"],["\u003cp\u003eTo view the status of a specific operation, you must first obtain the operation name, which you can then use in a \u003ccode\u003eGetOperation\u003c/code\u003e request.\u003c/p\u003e\n"],["\u003cp\u003eThe operation name can be found in the responses from commands like \u003ccode\u003eCreateBlockchainNode\u003c/code\u003e or \u003ccode\u003eDeleteBlockchainNode\u003c/code\u003e, as well as from the results of the \u003ccode\u003eListOperations\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eBoth \u003ccode\u003eListOperations\u003c/code\u003e and \u003ccode\u003eGetOperation\u003c/code\u003e requests require your project ID, the location of your resources, and the \u003ccode\u003eOPERATION_NAME\u003c/code\u003e in the case of \u003ccode\u003eGetOperation\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Check operation status\n\nThis page describes how to list all long-running operations and how to\nview the status of a long-running operation.\n\nTo check the status and display any additional error details of a long-running\noperation, you'll need to get the value for \u003cvar translate=\"no\"\u003eOPERATION_NAME\u003c/var\u003e\nfirst, and then you can request status.\n\nListOperations\n--------------\n\nTo list all long-running operations, send the following request: \n\n curl \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json\" \\\n https://blockchainnodeengine.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/\\\n locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/operations\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is your Google Cloud project ID. For example, `my-project-id`.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e is the [location](/blockchain-node-engine/docs/terms#location) in which your resources are hosted. For example, `us-central1`.\n\nHere is a sample response to this command: \n\n {\n \"operations\": [\n {\n \"name\": \"projects/my-project-id/locations/us-central1/operations/operation-1683321573175-5faf8d8696fe0-5f1906e4-eb1b6828\",\n \"metadata\": {\n \"@type\": \"type.googleapis.com/google.cloud.blockchainnodeengine.v1.OperationMetadata\",\n \"createTime\": \"2023-05-05T21:19:33.245698045Z\",\n \"endTime\": \"2023-05-05T21:58:44.520319810Z\",\n \"target\": \"projects/my-project-id/locations/us-central1/blockchainNodes/my-new-node-2\",\n \"verb\": \"create\",\n \"requestedCancellation\": false,\n \"apiVersion\": \"v1\"\n },\n \"done\": true,\n \"response\": {\n \"@type\": \"type.googleapis.com/google.cloud.blockchainnodeengine.v1.BlockchainNode\",\n \"name\": \"projects/my-project-id/locations/us-central1/blockchainNodes/my-new-node-2\",\n \"createTime\": \"2023-05-05T21:19:33.308756Z\",\n \"updateTime\": \"2023-05-05T21:58:44.513286Z\",\n \"labels\": {\n \"label-key\": \"label-value\"\n },\n \"blockchainType\": \"ETHEREUM\",\n \"connectionInfo\": {\n \"ipInfo\": {\n \"rpcIpv4Address\": \"203.0.113.1\"\n },\n \"endpointInfo\": {\n \"jsonRpcApiEndpoint\": \"json-rpc.4amkczs2vkh8hjtghcipu7y2t.blockchainnodeengine.com\",\n \"websocketsApiEndpoint\": \"ws.4amkczs2vkh8hjtghcipu7y2t.blockchainnodeengine.com\"\n }\n },\n \"ethereumDetails\": {\n \"network\": \"MAINNET\",\n \"nodeType\": \"FULL\",\n \"executionClient\": \"GETH\",\n \"consensusClient\": \"LIGHTHOUSE\",\n \"apiEnableAdmin\": false,\n \"apiEnableDebug\": false,\n \"additionalEndpoints\": {\n \"beaconApiEndpoint\": \"beacon.4amkczs2vkh8hjtghcipu7y2t.blockchainnodeengine.com\",\n \"beaconPrometheusMetricsApiEndpoint\": \"bc-mc.4amkczs2vkh8hjtghcipu7y2t.blockchainnodeengine.com\"\n }\n },\n \"state\": \"RUNNING\"\n }\n }\n ]\n }\n\nMake a note of the \u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e, which looks like\nthe following: \n\n \"name\": \"projects/my-project-id/locations/us-central1/operations/\n operation-1683321573175-5faf8d8696fe0-5f1906e4-eb1b6828\",\n\n| **Note:** You can also get this information using [ListBlockchainNodes](/blockchain-node-engine/docs/reference/rest/v1/projects.locations.blockchainNodes/list).\n\nGetOperation\n------------\n\nWhen you send a request and get a response, for example from\n[CreateBlockchainNode](/blockchain-node-engine/docs/reference/rest/v1/projects.locations.blockchainNodes/create) or\n[DeleteBlockchainNode](/blockchain-node-engine/docs/reference/rest/v1/projects.locations.blockchainNodes/delete),\nthe response includes the \u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e: \n\n \"name\": \"projects/my-project-id/locations/us-central1/operations/\n operation-1683321573175-5faf8d8696fe0-5f1906e4-eb1b6828\",\n\nFor this example, you'd set \u003cvar translate=\"no\"\u003eOPERATION_NAME\u003c/var\u003e to\n`operation-1683321573175-5faf8d8696fe0-5f1906e4-eb1b6828`.\n\nYou can also get the operation name from the results of the\n[ListOperations](/blockchain-node-engine/docs/reference/rest/v1/projects.locations.operations/list) command.\n\nOnce you have the value for \u003cvar translate=\"no\"\u003eOPERATION_NAME\u003c/var\u003e, send the\nfollowing request: \n\n curl \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json\" \\\n https://blockchainnodeengine.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/\\\n locations/\u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e/operations/\u003cvar translate=\"no\"\u003eOPERATION_NAME\u003c/var\u003e\n\nWhere:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is your Google Cloud project ID. For example `my-project-id`.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e is the [location](/blockchain-node-engine/docs/terms#location) in which your resources are hosted. For example, `us-central1`.\n- \u003cvar translate=\"no\"\u003eOPERATION_NAME\u003c/var\u003e is a string specifying the operation. For example, `operation-1683321573175-5faf8d8696fe0-5f1906e4-eb1b6828`.\n\nHere is an example response to the above command: \n\n {\n \"name\": \"projects/my-project-id/locations/us-central1/operations/operation-1683321573175-5faf8d8696fe0-5f1906e4-eb1b6828\",\n \"metadata\": {\n \"@type\": \"type.googleapis.com/google.cloud.blockchainnodeengine.v1.OperationMetadata\",\n \"createTime\": \"2023-05-05T21:19:33.245698045Z\",\n \"endTime\": \"2023-05-05T21:58:44.520319810Z\",\n \"target\": \"projects/my-project-id/locations/us-central1/blockchainNodes/my-new-node-2\",\n \"verb\": \"create\",\n \"requestedCancellation\": false,\n \"apiVersion\": \"v1\"\n },\n \"done\": true,\n \"response\": {\n \"@type\": \"type.googleapis.com/google.cloud.blockchainnodeengine.v1.BlockchainNode\",\n \"name\": \"projects/my-project-id/locations/us-central1/blockchainNodes/my-new-node-2\",\n \"createTime\": \"2023-05-05T21:19:33.308756Z\",\n \"updateTime\": \"2023-05-05T21:58:44.513286Z\",\n \"labels\": {\n \"label-key\": \"label-value\"\n },\n \"blockchainType\": \"ETHEREUM\",\n \"connectionInfo\": {\n \"ipInfo\": {\n \"rpcIpv4Address\": \"203.0.113.1\"\n },\n \"endpointInfo\": {\n \"jsonRpcApiEndpoint\": \"json-rpc.4amkczs2vkh8hjtghcipu7y2t.blockchainnodeengine.com\",\n \"websocketsApiEndpoint\": \"ws.4amkczs2vkh8hjtghcipu7y2t.blockchainnodeengine.com\"\n }\n },\n \"ethereumDetails\": {\n \"network\": \"MAINNET\",\n \"nodeType\": \"FULL\",\n \"executionClient\": \"GETH\",\n \"consensusClient\": \"LIGHTHOUSE\",\n \"apiEnableAdmin\": false,\n \"apiEnableDebug\": false,\n \"additionalEndpoints\": {\n \"beaconApiEndpoint\": \"beacon.4amkczs2vkh8hjtghcipu7y2t.blockchainnodeengine.com\",\n \"beaconPrometheusMetricsApiEndpoint\": \"bc-mc.4amkczs2vkh8hjtghcipu7y2t.blockchainnodeengine.com\"\n }\n },\n \"state\": \"RUNNING\"\n }\n }\n\n| **Note:** You can also get this information using [GetBlockchainNode](/blockchain-node-engine/docs/reference/rest/v1/projects.locations.blockchainNodes/get)."]]