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

Version Path
fog-azure-rm-0.6.0 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/requests/resources/list_resource_groups.rb
far-gem-0.5.6 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/requests/resources/list_resource_groups.rb
far-gem-0.5.5 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/requests/resources/list_resource_groups.rb
far-gem-0.5.4 lib/fog/azurerm/requests/resources/list_resource_groups.rb
far-gem-0.5.3 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/requests/resources/list_resource_groups.rb
far-gem-0.5.2 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/requests/resources/list_resource_groups.rb
far-gem-0.5.1 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/requests/resources/list_resource_groups.rb