cloud_clients/azure.py
async def list_all(
            self, subscription: Subscription, filter_func: Callable[[Vm], bool] = None, next_link: str = None
    ) -> Tuple[List[Vm], Optional[str]]:
        """
        list all VMs in subscriptions
        next link is for getting the next page of results
        filter func for filtering only vms that match filter conditions
        """
        if next_link:
            next_link_parsed = urlparse.urlparse(next_link)
            path = next_link_parsed.path
            parsed_query_params: Dict[str, List] = urlparse.parse_qs(next_link_parsed.query)
            query_params: Dict[str, str] = dict((k, v[0]) for k, v in parsed_query_params.items())  # convert dict style
        else:
            path = self.list_all_path.format(subscription_id=subscription.id)
            query_params = {"api-version": self.api_version, "statusOnly": "true"}

        data = await self.client.get(
            path=path,
            query_params=query_params,
            response_type=dict,
        )

        vms = []
        for vm_data in data["value"]:
            vm = Vm.from_raw_data(data=vm_data)
            if not filter_func or filter_func(vm):
                vms.append(vm)

        return vms, data.get("nextLink")

        list all VMs in subscriptions
        next link is for getting the next page of results
        filter func for filtering only vms that match filter conditions
        
list all VMs in subscriptions
next link is for getting the next page of results
filter func for filtering only vms that match filter conditions
list all VMs in subscriptions next link is for getting the next page of results filter func for filtering only vms that match filter conditions
async def list_all(
            self, subscription: Subscription, filter_func: Callable[[Vm], bool] = None, next_link: str = None
    ) -> Tuple[List[Vm], Optional[str]]:
        if next_link:
            next_link_parsed = urlparse.urlparse(next_link)
            path = next_link_parsed.path
            parsed_query_params: Dict[str, List] = urlparse.parse_qs(next_link_parsed.query)
            query_params: Dict[str, str] = dict((k, v[0]) for k, v in parsed_query_params.items())  
        else:
            path = self.list_all_path.format(subscription_id=subscription.id)
            query_params = {"api-version": self.api_version, "statusOnly": "true"}
        data = await self.client.get(
            path=path,
            query_params=query_params,
            response_type=dict,
        )
        vms = []
        for vm_data in data["value"]:
            vm = Vm.from_raw_data(data=vm_data)
            if not filter_func or filter_func(vm):
                vms.append(vm)
        return vms, data.get("nextLink")
async def list_all ( self , subscription : Subscription , filter_func : Callable [ [ Vm ] , bool ] = None , next_link : str = None ) -> Tuple [ List [ Vm ] , Optional [ str ] ] : if next_link : next_link_parsed = urlparse . urlparse ( next_link ) path = next_link_parsed . path parsed_query_params : Dict [ str , List ] = urlparse . parse_qs ( next_link_parsed . query ) query_params : Dict [ str , str ] = dict ( ( k , v [ 0 ] ) for k , v in parsed_query_params . items ( ) ) else : path = self . list_all_path . format ( subscription_id = subscription . id ) query_params = { "api-version" : self . api_version , "statusOnly" : "true" } data = await self . client . get ( path = path , query_params = query_params , response_type = dict , ) vms = [ ] for vm_data in data [ "value" ] : vm = Vm . from_raw_data ( data = vm_data ) if not filter_func or filter_func ( vm ) : vms . append ( vm ) return vms , data . get ( "nextLink" )
list all VMs in subscriptions
next link is for getting the next page of results
filter func for filtering only vms that match filter conditions
list all VMs in subscriptions next link is for getting the next page of results filter func for filtering only vms that match filter conditions
"""
        list all VMs in subscriptions
        next link is for getting the next page of results
        filter func for filtering only vms that match filter conditions
        """ # convert dict style
self
subscription
Subscription
filter_func
Callable[[Vm], bool]
next_link
str