Missing method implementation 66/7566/3
authorseryio <siyito.lpgc@gmail.com>
Wed, 29 May 2019 07:16:24 +0000 (09:16 +0200)
committerseryio <siyito.lpgc@gmail.com>
Wed, 29 May 2019 07:49:39 +0000 (09:49 +0200)
Change-Id: If585eedc95e293ab127b7b41efd2e59a82b5f6f0
Signed-off-by: seryio <siyito.lpgc@gmail.com>
osm_ro/vimconn_azure.py

index 24a9878..cdc1791 100755 (executable)
@@ -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