删除旧版网络

删除旧版 VMWare 网络。

代码示例

Python

如需向 VMware Engine 进行身份验证,请设置应用默认凭据。 如需了解详情,请参阅为本地开发环境设置身份验证

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

后续步骤

如需搜索和过滤其他 Google Cloud 产品的代码示例,请参阅 Google Cloud 示例浏览器