Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
O Connectivity Tests oferece suporte à verificação periódica do status de uma operação de teste em execução, como create, update ou delete. Você ainda pode revisar os resultados finais do teste quando o teste for concluído.
Console
O console Google Cloud usa um ícone giratório para mostrar um teste em execução.
Nos bastidores, o Connectivity Tests pesquisa continuamente o status da operação de teste. Quando o teste for concluído, você poderá verificar os
resultados finais no painel Detalhes do resultado.
Para usar a CLI gcloud para verificar uma operação de teste em execução,
especifique a opção --async. Se você não especificar esta opção, verá
apenas os resultados finais do teste.
Por exemplo, criar o teste a seguir usando a opção --async retorna
imediatamente um ID de recurso de operação para a linha de comando. Você pode usar esse código em um comando describe subsequente para verificar o status do teste enquanto o teste ainda está em execução.
DESTINATION_PROJECT: o ID do projeto do
endpoint de destino
SOURCE_IP_ADDRESS: o endereço IP de origem interno ou externo
que você está testando. Um endereço IPv6
só é permitido quando o destino do teste é um VIP do balanceador de carga global
DESTINATION_IP_ADDRESS: o endereço IP de origem interno ou externo que você está testando. Um endereço IPv6 só
é permitido quando o destino do teste é um VIP do balanceador de carga global
SOURCE_PROJECT: o ID do projeto do
endpoint de origem
A saída é esta:
Create request issued for: [gcloud-example]
Check operation [projects/reachability-e2e-test/locations/global/operations/operation-1580411210002-59d6028c56f71-85ef2899-54d8bc13] for status
Use o ID do recurso de operação com o comando describe para verificar o status do teste:
SOURCE_PROJECT: o ID do projeto do endpoint de origem
OPERATION_RESOURCE_ID: o ID do recurso da operação em
andamento que você está verificando (por exemplo,
operation-1580411210002-59d6028c56f71-85ef2899-54d8bc13)
A seguinte amostra de saída para o comando anterior mostra done: false.
Quando o teste é concluído, este campo muda para done: true.
Repita o comando describe anterior até que a saída mostre done: true.
API
A API de gerenciamento de rede está sempre no modo async. Ao emitir um comando para a API, você recebe imediatamente um código da operação. Você pode usar esse código para verificar periodicamente o status do teste.
Python
A API de gerenciamento de rede está sempre no modo async. Ao usar o
cliente Python da API para emitir uma solicitação, você recebe imediatamente um ID de operação.
Você pode usar esse ID para verificar periodicamente o status do teste.
PROJECT_ID: o ID do projeto em que
você criou o teste
OPERATION_ID: o ID do recurso da operação em
andamento que você está verificando (por exemplo,
operation-1580411210002-59d6028c56f71-85ef2899-54d8bc13)
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-08-18 UTC."],[],[],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)"]]