Eliminar una red antigua

Elimina una red de VMWare antigua.

Código de ejemplo

Python

Para autenticarte en VMware Engine, configura las credenciales predeterminadas de la aplicación. Para obtener más información, consulta el artículo Configurar la autenticación en un entorno de desarrollo local.

from google.api_core import operation
from google.cloud import vmwareengine_v1


def delete_legacy_network(project_id: str, region: str) -> operation.Operation:
    """
    Deletes a legacy VMware Network.

    Args:
        project_id: name of the project hosting the network.
        region: region in which the legacy network is located in.

    Returns:
        An Operation object related to started network deletion operation.
    """
    client = vmwareengine_v1.VmwareEngineClient()
    return client.delete_vmware_engine_network(
        name=f"projects/{project_id}/"
        f"locations/{region}/"
        f"vmwareEngineNetworks/{region}-default"
    )

Siguientes pasos

Para buscar y filtrar ejemplos de código de otros Google Cloud productos, consulta el Google Cloud navegador de ejemplos.