lib/azure/armrest/virtual_machine_service.rb in azure-armrest-0.9.13 vs lib/azure/armrest/virtual_machine_service.rb in azure-armrest-0.9.14

- old
+ new

@@ -14,10 +14,18 @@ # def initialize(configuration, options = {}) super(configuration, 'virtualMachines', 'Microsoft.Compute', options) end + # Return a list of virtual machines for the given +location+. + # + def list_by_location(location, options = {}) + url = url_with_api_version(api_version, base_url, 'providers', provider, 'locations', location, service_name) + response = rest_get(url) + get_all_results(response, options[:skip_accessors_definition]) + end + # Return a list of available VM series (aka sizes, flavors, etc), such # as "Basic_A1", though other information is included as well. # def series(location) namespace = 'microsoft.compute' @@ -304,11 +312,14 @@ def vm_operate(action, vmname, group, options = {}) raise ArgumentError, "must specify resource group" unless group raise ArgumentError, "must specify name of the vm" unless vmname url = build_url(group, vmname, action) - rest_post(url) - nil + response = rest_post(url) + + Azure::Armrest::ResponseHeaders.new(response.headers).tap do |headers| + headers.response_code = response.code + end end end end end