Eliminar política de red

Elimina una política de red.

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_network_policy(project_id: str, region: str) -> operation.Operation:
    """
    Delete a Network Policy.

    Args:
        project_id: name of the project hosting the policy.
        region: name of the region hosting the policy. I.e. "us-central1"

    Return:
        Operation object. You can use .result() to wait for it to finish.
    """
    client = vmwareengine_v1.VmwareEngineClient()
    return client.delete_network_policy(
        name=f"projects/{project_id}/locations/{region}/networkPolicies/{region}-default"
    )

Siguientes pasos

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