刪除聯播網政策

刪除網路政策。

程式碼範例

Python

如要向 VMware Engine 進行驗證,請設定應用程式預設憑證。 詳情請參閱「為本機開發環境設定驗證」。

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

後續步驟

如要搜尋及篩選其他 Google Cloud 產品的程式碼範例,請參閱Google Cloud 範例瀏覽器