当前位置: 首页>>代码示例>>Python>>正文


Python ServiceManagementService.list_vm_images方法代码示例

本文整理汇总了Python中azure.servicemanagement.ServiceManagementService.list_vm_images方法的典型用法代码示例。如果您正苦于以下问题:Python ServiceManagementService.list_vm_images方法的具体用法?Python ServiceManagementService.list_vm_images怎么用?Python ServiceManagementService.list_vm_images使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在azure.servicemanagement.ServiceManagementService的用法示例。


在下文中一共展示了ServiceManagementService.list_vm_images方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_certificate_from_publish_settings

# 需要导入模块: from azure.servicemanagement import ServiceManagementService [as 别名]
# 或者: from azure.servicemanagement.ServiceManagementService import list_vm_images [as 别名]
    subscription_id = get_certificate_from_publish_settings(
        publish_settings_path='./azure/certs/subscription.publishsettings',
        path_to_write_certificate=pem_file,
        subscription_id=subscription_id
    )

    sms = ServiceManagementService(subscription_id, pem_file)
    
    if not os.path.exists('./azure/data'):
        os.mkdir('./azure/data')

    result = sms.list_os_images()
    process_sms_list(result.images, './azure/data/azure_os_images.csv')
    print ('Azure OS images saved in azure_os_images.csv')

    result = sms.list_vm_images()
    process_sms_list(result.vm_images, './azure/data/azure_vm_images.csv')
    print ('Azure VM images saved in azure_vm_images.csv')

    result = sms.list_role_sizes()
    process_sms_list(result.role_sizes, './azure/data/azure_role_sizes.csv')
    print ('Azure Role sizes saved in azure_role_sizes.csv')

    result = sms.list_locations()
    process_sms_list(result.locations, './azure/data/azure_locations.csv')
    print ('Azure Locations saved in azure_locations.csv')

    result = sms.list_storage_accounts()
    process_sms_list(result.storage_services, './azure/data/azure_storage_accounts.csv')
    print ('Azure Storage accounts saved in azure_storage_accounts.csv')
开发者ID:dominoFire,项目名称:sweeper-extractor,代码行数:32,代码来源:list_services.py


注:本文中的azure.servicemanagement.ServiceManagementService.list_vm_images方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。