当前位置: 首页>>代码示例>>Python>>正文


Python VDC.create_routed_vdc_network方法代码示例

本文整理汇总了Python中pyvcloud.vcd.vdc.VDC.create_routed_vdc_network方法的典型用法代码示例。如果您正苦于以下问题:Python VDC.create_routed_vdc_network方法的具体用法?Python VDC.create_routed_vdc_network怎么用?Python VDC.create_routed_vdc_network使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyvcloud.vcd.vdc.VDC的用法示例。


在下文中一共展示了VDC.create_routed_vdc_network方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_routed_ovdc_network

# 需要导入模块: from pyvcloud.vcd.vdc import VDC [as 别名]
# 或者: from pyvcloud.vcd.vdc.VDC import create_routed_vdc_network [as 别名]
    def create_routed_ovdc_network(cls):
        """Creates a routed org vdc network.

        The name of the created org vdc network is specified in the
        ovdc_network_constant file, skips creating one, if such a network already
        exists.

        :raises: Exception: if the class variable _ovdc_href is not populated.
        """
        cls._basic_check()
        if cls._ovdc_href is None:
            raise Exception('OrgVDC ' +
                            cls._config['vcd']['default_ovdc_name'] +
                            ' doesn\'t exist.')

        vdc = VDC(cls._sys_admin_client, href=cls._ovdc_href)

        expected_net_name = OvdcNetConstants.routed_net_name
        records_list = vdc.list_orgvdc_network_records()

        for network_record in records_list:
            if network_record['name'].lower() == expected_net_name.lower():
                cls._logger.debug('Reusing existing direct org-vdc network ' +
                                  expected_net_name)
                return

        result = vdc.create_routed_vdc_network(
            network_name=OvdcNetConstants.routed_net_name,
            gateway_name=GatewayConstants.name,
            network_cidr=OvdcNetConstants.routed_orgvdc_network_gateway_ip,
            description='org vdc network description')

        cls._sys_admin_client.get_task_monitor() \
            .wait_for_success(task=result.Tasks.Task[0])
开发者ID:vmware,项目名称:pyvcloud,代码行数:36,代码来源:environment.py

示例2: test_005_create_routed_orgvdc_network

# 需要导入模块: from pyvcloud.vcd.vdc import VDC [as 别名]
# 或者: from pyvcloud.vcd.vdc.VDC import create_routed_vdc_network [as 别名]
    def test_005_create_routed_orgvdc_network(self):
        org_record = self.client.get_org_by_name(
            self.config['vcd']['org_name'])
        org = Org(self.client, href=org_record.get('href'))
        vdc_resource = org.get_vdc(self.config['vcd']['vdc_name'])
        vdc = VDC(self.client, href=vdc_resource.get('href'))

        result = vdc.create_routed_vdc_network(
            network_name=self.config['vcd']['vdc_routed_network_name'],
            gateway_name=self.config['vcd']['routed_network_gateway_name'],
            network_cidr=self.config['vcd']['network_cidr'],
            description='Dummy description')
        task = self.client.get_task_monitor().wait_for_success(
            task=result.Tasks.Task[0])
        assert task.get('status') == TaskStatus.SUCCESS.value
开发者ID:vmware,项目名称:pyvcloud,代码行数:17,代码来源:vcd_network.py

示例3: __create_routed_ovdc_network

# 需要导入模块: from pyvcloud.vcd.vdc import VDC [as 别名]
# 或者: from pyvcloud.vcd.vdc.VDC import create_routed_vdc_network [as 别名]
    def __create_routed_ovdc_network(self):
        """Creates a routed org vdc network.

        :raises: Exception: if the class variable _ovdc_href is not populated.
        """
        vdc_reource = TestIpSecVpn._vdc_resource
        vdc = VDC(TestIpSecVpn._client, resource=vdc_reource)
        routednet = vdc.create_routed_vdc_network(
            network_name=TestIpSecVpn._routed_network_name,
            gateway_name=TestIpSecVpn._gateway_name,
            network_cidr=TestIpSecVpn._routed_orgvdc_network_gateway_ip,
            description='org vdc network description')
        TestIpSecVpn._client.get_task_monitor() \
            .wait_for_success(task=routednet.Tasks.Task[0])

        TestIpSecVpn._routednet_href = routednet.get('href')
        TestIpSecVpn._routednet_obj = VdcNetwork(TestIpSecVpn._client,
                                                 href=TestIpSecVpn.
                                                 _routednet_href)
        TestIpSecVpn._routednet_resource = TestIpSecVpn. \
            _routednet_obj.get_resource()
开发者ID:vmware,项目名称:vca-cli,代码行数:23,代码来源:ipsec_vpn_tests.py


注:本文中的pyvcloud.vcd.vdc.VDC.create_routed_vdc_network方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。