adh_cache.py
def populate_host (self, curr_host, dhg_name,subscription_id, access_token):
        '''Populate a dedicated host with host object including VM IDs
            Args:
                curr_host (str): Dedicated Host JSON object 
        '''
        self.subscription_id = subscription_id
        self.name = curr_host['name']
        self.sku = curr_host['sku']['name']
        self.location = curr_host['location']
        self.id = curr_host['id']
        resource_id = self.id.split("/")
        self.resource_group =(resource_id[4])

        self.group_name = dhg_name
        if 'faultDomain' in curr_host['properties']:
            self.fault_domain = curr_host['properties']['faultDomain']
        for curr_vm in curr_host['properties']['virtualMachines']:
            vm = VM()
            vm.id = curr_vm['id'].upper()
            self.vm_list[vm.id]=vm
            # logger.debug ("populate a VM %s",vm.id)
        host_instance_view = get_dh(access_token, self.subscription_id, self.resource_group,self.group_name, self.name)
        for allocable_sku in host_instance_view['properties']['instanceView']['availableCapacity']['allocatableVMs']:
            self.allocatableVMs[allocable_sku['vmSize']]=int(allocable_sku['count'])
Populate a dedicated host with host object including VM IDs
            Args:
                curr_host (str): Dedicated Host JSON object 
        
Populate a dedicated host with host object including VM IDs
Populate a dedicated host with host object including VM IDs
def populate_host (self, curr_host, dhg_name,subscription_id, access_token):
        self.subscription_id = subscription_id
        self.name = curr_host['name']
        self.sku = curr_host['sku']['name']
        self.location = curr_host['location']
        self.id = curr_host['id']
        resource_id = self.id.split("/")
        self.resource_group =(resource_id[4])
        self.group_name = dhg_name
        if 'faultDomain' in curr_host['properties']:
            self.fault_domain = curr_host['properties']['faultDomain']
        for curr_vm in curr_host['properties']['virtualMachines']:
            vm = VM()
            vm.id = curr_vm['id'].upper()
            self.vm_list[vm.id]=vm
        host_instance_view = get_dh(access_token, self.subscription_id, self.resource_group,self.group_name, self.name)
        for allocable_sku in host_instance_view['properties']['instanceView']['availableCapacity']['allocatableVMs']:
            self.allocatableVMs[allocable_sku['vmSize']]=int(allocable_sku['count'])
def populate_host ( self , curr_host , dhg_name , subscription_id , access_token ) : self . subscription_id = subscription_id self . name = curr_host [ 'name' ] self . sku = curr_host [ 'sku' ] [ 'name' ] self . location = curr_host [ 'location' ] self . id = curr_host [ 'id' ] resource_id = self . id . split ( "/" ) self . resource_group = ( resource_id [ 4 ] ) self . group_name = dhg_name if 'faultDomain' in curr_host [ 'properties' ] : self . fault_domain = curr_host [ 'properties' ] [ 'faultDomain' ] for curr_vm in curr_host [ 'properties' ] [ 'virtualMachines' ] : vm = VM ( ) vm . id = curr_vm [ 'id' ] . upper ( ) self . vm_list [ vm . id ] = vm host_instance_view = get_dh ( access_token , self . subscription_id , self . resource_group , self . group_name , self . name ) for allocable_sku in host_instance_view [ 'properties' ] [ 'instanceView' ] [ 'availableCapacity' ] [ 'allocatableVMs' ] : self . allocatableVMs [ allocable_sku [ 'vmSize' ] ] = int ( allocable_sku [ 'count' ] )
Populate a dedicated host with host object including VM IDs
Populate a dedicated host with host object including VM IDs
'''Populate a dedicated host with host object including VM IDs
            Args:
                curr_host (str): Dedicated Host JSON object 
        ''' # logger.debug ("populate a VM %s",vm.id)
self
curr_host
Dedicated Host JSON object
Dedicated Host JSON object
dhg_name
subscription_id
access_token