Liste as localizações do VMWare Engine disponíveis

Imprime uma lista de localizações disponíveis para utilização no VMWare Engine.

Exemplo de código

Python

Para se autenticar no VMware Engine, configure as Credenciais padrão da aplicação. Para mais informações, consulte o artigo Configure a autenticação para um ambiente de desenvolvimento local.

from google.cloud import vmwareengine_v1
from google.cloud.location.locations_pb2 import ListLocationsRequest


def list_locations(project_id: str) -> str:
    """
    Prints a list of available locations for use in VMware Engine.

    Args:
        project_id: name of the project you want to use.

    Returns:
        String containing the list of all available locations.
    """
    client = vmwareengine_v1.VmwareEngineClient()
    request = ListLocationsRequest()
    request.name = f"projects/{project_id}"
    locations = client.list_locations(request)
    print(locations)
    return str(locations)

O que se segue?

Para pesquisar e filtrar exemplos de código para outros Google Cloud produtos, consulte o Google Cloud navegador de exemplos.