def test_0001_convert_to_advanced(self): """Convert the legacy gateway to advance gateway. Invoke the convert_to_advanced method for gateway. """ gateway_obj = Gateway(TestGateway._client, self._name, TestGateway._gateway.get('href')) task = gateway_obj.convert_to_advanced() result = TestGateway._client.get_task_monitor().wait_for_success( task=task) self.assertEqual(result.get('status'), TaskStatus.SUCCESS.value)
def test_0001_convert_to_advanced(self): """Convert the legacy gateway to advance gateway. Invoke the convert_to_advanced method for gateway. """ if float(TestGateway._api_version) >= float( ApiVersion.VERSION_32.value): return gateway_obj = Gateway(TestGateway._org_client, self._name, TestGateway._gateway.get('href')) task = gateway_obj.convert_to_advanced() result = TestGateway._client.get_task_monitor().wait_for_success( task=task) self.assertEqual(result.get('status'), TaskStatus.SUCCESS.value)
def convert_to_advanced_gateway(ctx, name): """Convert to advanced gateway. \b Note System Administrators and Organization Administrator can convert legacy gateway to advanced. \b Examples vcd gateway convert-to-advanced <gateway-name> Convert gateway to advanced by providing gateway name """ try: restore_session(ctx, vdc_required=True) client = ctx.obj['client'] vdc_href = ctx.obj['profiles'].get('vdc_href') vdc = VDC(client, href=vdc_href) gateway = vdc.get_gateway(name) gateway_resource = Gateway(client, href=gateway.get('href')) task = gateway_resource.convert_to_advanced() stdout(task, ctx) except Exception as e: stderr(e, ctx)