examples/collect_inventory.py
def collect_inv(spc, num_threads):
    """
    Get first 200 devices from Space and use a ThreadPoolExecutor to
    collect their inventory.
    """
    global remaining
    devices = spc.device_management.devices.get(
                            filter_={'managedStatus': 'In Sync'},
                            paging={'start': 0, 'limit': 200},
                            sortby=['name', 'platform'])

    print("There are %d devices to process" % len(devices))
    remaining = len(devices)

    with concurrent.futures.ThreadPoolExecutor(max_workers=int(num_threads)) as executor:
        for device in devices:
            f = executor.submit(process_device, spc, device)
            f.add_done_callback(finished)

    print("\nAll Over!!!")

    Get first 200 devices from Space and use a ThreadPoolExecutor to
    collect their inventory.
    
Get first 200 devices from Space and use a ThreadPoolExecutor to
collect their inventory.
Get first 200 devices from Space and use a ThreadPoolExecutor to collect their inventory .
def collect_inv(spc, num_threads):
    global remaining
    devices = spc.device_management.devices.get(
                            filter_={'managedStatus': 'In Sync'},
                            paging={'start': 0, 'limit': 200},
                            sortby=['name', 'platform'])
    print("There are %d devices to process" % len(devices))
    remaining = len(devices)
    with concurrent.futures.ThreadPoolExecutor(max_workers=int(num_threads)) as executor:
        for device in devices:
            f = executor.submit(process_device, spc, device)
            f.add_done_callback(finished)
    print("\nAll Over!!!")
def collect_inv ( spc , num_threads ) : global remaining devices = spc . device_management . devices . get ( filter_ = { 'managedStatus' : 'In Sync' } , paging = { 'start' : 0 , 'limit' : 200 } , sortby = [ 'name' , 'platform' ] ) print ( "There are %d devices to process" % len ( devices ) ) remaining = len ( devices ) with concurrent . futures . ThreadPoolExecutor ( max_workers = int ( num_threads ) ) as executor : for device in devices : f = executor . submit ( process_device , spc , device ) f . add_done_callback ( finished ) print ( "\nAll Over!!!" )
Get first 200 devices from Space and use a ThreadPoolExecutor to
collect their inventory.
Get first 200 devices from Space and use a ThreadPoolExecutor to collect their inventory .
"""
    Get first 200 devices from Space and use a ThreadPoolExecutor to
    collect their inventory.
    """
spc
num_threads