Menghapus kebijakan jaringan

Menghapus kebijakan jaringan.

Contoh kode

Python

Untuk melakukan autentikasi ke VMware Engine, siapkan Kredensial Default Aplikasi. Untuk mengetahui informasi selengkapnya, baca Menyiapkan autentikasi untuk lingkungan pengembangan lokal.

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"
    )

Langkah berikutnya

Untuk menelusuri dan memfilter contoh kode untuk produk Google Cloud lainnya, lihat Google Cloud browser contoh.