删除广告资源网政策

删除网络政策。

代码示例

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 示例浏览器