def __convert_to_subinterface(self, client): vdc = Environment.get_test_vdc(client) org_vdc_routed_nw = vdc.get_routed_orgvdc_network( TestNetwork._routed_org_vdc_network_name) vdc_network = VdcNetwork(client, resource=org_vdc_routed_nw) result = vdc_network.convert_to_sub_interface() task = TestNetwork._client.get_task_monitor().wait_for_success( task=result) self.assertEqual(task.get('status'), TaskStatus.SUCCESS.value) # Verify vdc_network.reload_admin() reloaded_vdc_network = vdc_network.admin_resource self.assertTrue(reloaded_vdc_network.Configuration.SubInterface) # Revert to Internal Interface result = vdc_network.convert_to_internal_interface() task = TestNetwork._client.get_task_monitor().wait_for_success( task=result) self.assertEqual(task.get('status'), TaskStatus.SUCCESS.value) # Verify vdc_network.reload_admin() reloaded_vdc_network = vdc_network.admin_resource self.assertFalse(reloaded_vdc_network.Configuration.SubInterface)
def __convert_to_subinterface(self, client): vdc = Environment.get_test_vdc(client) org_vdc_routed_nw = vdc.get_routed_orgvdc_network( TestNetwork._routed_org_vdc_network_name) vdc_network = VdcNetwork(client, resource=org_vdc_routed_nw) result = vdc_network.convert_to_sub_interface() task = TestNetwork._client.get_task_monitor().wait_for_success( task=result) self.assertEqual(task.get('status'), TaskStatus.SUCCESS.value) # Verify vdc_network.reload_admin() reloaded_vdc_network = vdc_network.admin_resource self.assertTrue(reloaded_vdc_network.Configuration.SubInterface) # Revert to Internal Interface result = vdc_network.convert_to_internal_interface() task = TestNetwork._client.get_task_monitor().wait_for_success( task=result) self.assertEqual(task.get('status'), TaskStatus.SUCCESS.value) # Verify vdc_network.reload_admin() reloaded_vdc_network = vdc_network.admin_resource self.assertFalse(reloaded_vdc_network.Configuration.SubInterface)
def convert_to_sub_interface(ctx, name): try: vdc = _get_vdc_ref(ctx) client = ctx.obj['client'] routed_network = vdc.get_routed_orgvdc_network(name) vdcNetwork = VdcNetwork(client, resource=routed_network) task = vdcNetwork.convert_to_sub_interface() stdout(task, ctx) except Exception as e: stderr(e, ctx)