From 07ad136eac22e055b0d66eae60833e3258ae5a0a Mon Sep 17 00:00:00 2001 From: seryio Date: Wed, 29 May 2019 09:16:24 +0200 Subject: [PATCH] Missing method implementation Change-Id: If585eedc95e293ab127b7b41efd2e59a82b5f6f0 Signed-off-by: seryio --- osm_ro/vimconn_azure.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/osm_ro/vimconn_azure.py b/osm_ro/vimconn_azure.py index 24a9878d..cdc17916 100755 --- a/osm_ro/vimconn_azure.py +++ b/osm_ro/vimconn_azure.py @@ -425,10 +425,25 @@ class vimconnector(vimconn.vimconnector): for vm_size in self.conn_compute.virtual_machine_sizes.list(self.region): if vm_size.name == flavor_id : return vm_size + + def refresh_nets_status(self, net_id): + resGroup = self._get_resource_group_name_from_resource_id(net_id) + resName = self._get_resource_name_from_resource_id(net_id) + + self._reload_connection() + vnet = self.conn_vnet.virtual_networks.get(resGroup, resName) + + return vnet + + def refresh_vms_status(self, vm_id): + resGroup = self._get_resource_group_name_from_resource_id(net_id) + resName = self._get_resource_name_from_resource_id(net_id) + + self._reload_connection() + vm=self.conn_compute.virtual_machines.get(resGroup, resName) + return vm -# TODO refresh_nets_status ver estado activo -# TODO refresh_vms_status ver estado activo # TODO get_vminstance_console for getting console if __name__ == "__main__": @@ -492,4 +507,4 @@ if __name__ == "__main__": # azure.new_vminstance(virtualMachine['name'], virtualMachine['description'], virtualMachine['status'], # virtualMachine['image'], virtualMachine['hardware_profile']['vm_size'], subnets) - azure.get_flavor("Standard_A11") \ No newline at end of file + azure.refresh_nets_status("/subscriptions/82f80cc1-876b-4591-9911-1fb5788384fd/resourceGroups/osmRG/providers/Microsoft.Network/virtualNetworks/test") \ No newline at end of file -- 2.25.1