Sha256: 7aa277881825d584f162c4e217e7440bea5d6c76bd5de5b1620794ea7b4de05f
Contents?: true
Size: 1.68 KB
Versions: 47
Compression:
Stored size: 1.68 KB
Contents
module Fog module Resources class AzureRM # This class provides the actual implementation for service calls. class Real def list_resource_groups msg = 'Listing Resource Groups' Fog::Logger.debug msg begin resource_groups = @rmc.resource_groups.list_as_lazy rescue MsRestAzure::AzureOperationError => e raise_azure_exception(e, msg) end resource_groups.next_link = '' if resource_groups.next_link.nil? Fog::Logger.debug 'Resource Groups listed successfully' resource_groups.value end end # This class provides the mock implementation for unit tests. class Mock def list_resource_groups resource_groups = { 'value' => [ { 'location' => 'westus', 'id' => '/subscriptions/########-####-####-####-############/resourceGroups/Fog_test_rg', 'name' => 'Fog_test_rg', 'properties' => { 'provisioningState' => 'Succeeded' } }, { 'location' => 'westus', 'id' => '/subscriptions/########-####-####-####-############/resourceGroups/Fog_test_rg1', 'name' => 'Fog_test_rg1', 'properties' => { 'provisioningState' => 'Succeeded' } } ] } result_mapper = Azure::ARM::Resources::Models::ResourceGroupListResult.mapper @rmc.deserialize(result_mapper, resource_groups, 'result.body').value end end end end end
Version data entries
47 entries across 47 versions & 4 rubygems