lib/azure/armrest/virtual_machine_service.rb in azure-armrest-0.2.10 vs lib/azure/armrest/virtual_machine_service.rb in azure-armrest-0.3.0

- old
+ new

@@ -15,17 +15,18 @@ def initialize(configuration, options = {}) super(configuration, 'virtualMachines', 'Microsoft.Compute', options) end # Return a list of available VM series (aka sizes, flavors, etc), such - # as "Basic_A1", though information is included as well. + # as "Basic_A1", though other information is included as well. # def series(location) - unless @@providers_hash[provider.downcase] && @@providers_hash[provider.downcase]['locations/vmsizes'] - raise ArgumentError, "Invalid provider '#{provider}'" - end + namespace = 'microsoft.compute' + version = configuration.provider_default_api_version(namespace, 'locations/vmsizes') - version = @@providers_hash[provider.downcase]['locations/vmsizes']['api_version'] + unless version + raise ArgumentError, "Unable to find resources for #{namespace}" + end url = url_with_api_version( version, @base_url, 'subscriptions', configuration.subscription_id, 'providers', provider, 'locations', location, 'vmSizes' )