resourcelookup#

Tools for looking up available Azure resources.

Functions#

sku_to_dict(sku)

Convert a SupportedSku object to

lookup_available_vm_skus_for_batch([client, ...])

Look up available VM image

Module Contents#

sku_to_dict(sku: azure.mgmt.batch.models.SupportedSku)#

Convert a SupportedSku object to a flat dictionary or property names and values.

Parameters#

sku

The SupportedSku object to convert.

Returns#

dict

A flat dictionary with keys 'name', 'family_name', 'batch_support_end_of_life', 'additional_properties', as well as keys and values corresponding to any SkuCapability objects associated to the SupportedSku.

lookup_available_vm_skus_for_batch(client: azure.mgmt.batch.BatchManagementClient = None, config_dict: dict = None, try_env: bool = True, to_dict: bool = True, **kwargs)#

Look up available VM image SKUs for the given batch service.

Parameters#

client

BatchManagementClient to use when looking up the available images. If None, use the output of get_batch_management_client(). Default None.

config_dict

Configuration dictionary. Passed as the config_dict argument to any internal config.get_config_val() calls. See that function’s documentation for additional details.

try_env

Whether to look for configuration values in the available environment variables. Passed as the try_env argument to to any internal config.get_config_val() calls. See that function’s documentation for additional details.

to_dict

Apply sku_to_dict() to the list of results? Default True. If False, the result will be a list of SupportedSku objects.

**kwargs

Additional keyword arguments passed to BatchManagementClient.location.list_supported_virtual_machine_skus().

Returns#

list

Of supported SKUs, either as dictionaries of property names and values (default) or as raw SupportedSku objects (if to_dict is False).