Create request issued for: [gcloud-example]
Check operation [projects/reachability-e2e-test/locations/global/operations/operation-1580411210002-59d6028c56f71-85ef2899-54d8bc13] for status
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-03 (世界標準時間)。"],[],[],null,["# Check a running test operation\n\nConnectivity Tests supports periodically checking the status of\na running test operation, such as `create`, `update`, or `delete`. You can\nstill review the final test results when the test completes. \n\n### Console\n\nThe Google Cloud console uses a spinner icon to show a running test.\nBehind the scenes, Connectivity Tests continuously polls for\nthe status of the test operation. When the test completes, you can check the\nfinal results in the **Result details** panel.\n\nFor more information about Google Cloud console pages, see\n[Create and run Connectivity Tests](/network-intelligence-center/docs/connectivity-tests/how-to/running-connectivity-tests).\n\n### gcloud\n\nTo use the gcloud CLI to check a running test operation,\nspecify the `--async` option. If you don't specify this option, you see only\nthe final test results.\n\n1. For example, creating the following test by using the `--async` option\n immediately returns an *operation resource ID* to the command line. You\n can then use this ID in a subsequent `describe` command to check test\n status while the test is still running.\n\n ```\n gcloud network-management connectivity-tests create NAME \\\n --destination-project=DESTINATION_PROJECT \\\n --source-ip-address=SOURCE_IP_ADDRESS \\\n --destination-ip-address=DESTINATION_IP_ADDRESS \\\n --protocol=PROTOCOL \\\n --source-project=SOURCE_PROJECT \\\n --async\n ```\n\n Replace the following values:\n - \u003cvar translate=\"no\"\u003eNAME\u003c/var\u003e: the name of the Connectivity Tests\n - \u003cvar translate=\"no\"\u003eDESTINATION_PROJECT\u003c/var\u003e: the project ID of the destination endpoint\n - \u003cvar translate=\"no\"\u003eSOURCE_IP_ADDRESS\u003c/var\u003e: the internal or external source IP address that you are testing from; an IPv6 address is only allowed when the test's destination is a global load balancer VIP\n - \u003cvar translate=\"no\"\u003eDESTINATION_IP_ADDRESS\u003c/var\u003e: the internal or external source IP address that you are testing to; an IPv6 address is only allowed when the test's destination is a global load balancer VIP\n - \u003cvar translate=\"no\"\u003ePROTOCOL\u003c/var\u003e: a [supported\n protocol](/network-intelligence-center/docs/connectivity-tests/concepts/overview#endpoints) for Connectivity Tests\n - \u003cvar translate=\"no\"\u003eSOURCE_PROJECT\u003c/var\u003e: the project ID of the source endpoint\n\n The output is the following: \n\n ```\n Create request issued for: [gcloud-example]\n Check operation [projects/reachability-e2e-test/locations/global/operations/operation-1580411210002-59d6028c56f71-85ef2899-54d8bc13] for status\n ```\n2. Use the operation resource ID with the `describe`\n command to check on the test's status:\n\n ```\n gcloud network-management operations describe \\\n projects/SOURCE_PROJECT/locations/global/operations/OPERATION_RESOURCE_ID\n ```\n\n Replace the following values:\n - \u003cvar translate=\"no\"\u003eSOURCE_PROJECT\u003c/var\u003e: the project ID of the source endpoint\n - \u003cvar translate=\"no\"\u003eOPERATION_RESOURCE_ID\u003c/var\u003e: the resource ID for the in-progress operation that you are checking (for example, `operation-1580411210002-59d6028c56f71-85ef2899-54d8bc13`)\n\n The following sample output for the previous command shows `done: false`.\n When the test completes, this field changes to `done: true`. \n\n ```\n done: false\n metadata:\n '@type': type.googleapis.com/google.cloud.networkmanagement.v1.OperationMetadata\n apiVersion: v1\n cancelRequested: false\n createTime: '2020-01-30T19:06:50.055838110Z'\n endTime: '2020-01-30T19:06:57.637200039Z'\n target: projects/reachability-e2e-test/locations/global/connectivityTests/gcloud-example\n verb: create\n name:\n projects/reachability-e2e-test/locations/global/operations/operation-1580411210002-59d6028c56f71-85ef2899-54d8bc13\n response:\n '@type': type.googleapis.com/google.cloud.networkmanagement.v1beta1.ConnectivityTest\n createTime: '2020-01-30T19:06:50.050012906Z'\n ... // Full resource metadata displayed here.\n ```\n3. Repeat the previous `describe` command until the output shows `done: true`.\n\n### API\n\nThe Network Management API is always in `async` mode. When you issue\na command to the API, you immediately receive an operation ID. You can\nuse this ID to periodically check test status.\n\n### Python\n\nThe Network Management API is always in `async` mode. When you use the\nAPI Python client to issue a request, you immediately receive an operation ID.\nYou can use this ID to periodically check test status.\n\nSee the following example: \n\n```\nproject_id = 'PROJECT_ID'\noperation_id = 'OPERATION_ID'\n\nrequest = api.projects().locations().global_().operations().get(\n name='projects/%s/locations/global/operations/%s' % (project_id, operation_id))\n\nprint(json.dumps(request.execute(), indent=4))\n```\n\nReplace the following values:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID for the project in which you created the test\n- \u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e: the resource ID for the in-progress operation that you are checking (for example, `operation-1580411210002-59d6028c56f71-85ef2899-54d8bc13`)\n\nWhat's next\n-----------\n\n- [Learn about Connectivity Tests](/network-intelligence-center/docs/connectivity-tests/concepts/overview)\n- [Troubleshoot Connectivity Tests](/network-intelligence-center/docs/connectivity-tests/support/troubleshooting)"]]