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.4.1 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.4.0 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.2.7 lib/fog/azurerm/requests/resources/list_resource_groups.rb
fog-azure-rm-0.2.6 lib/fog/azurerm/requests/resources/list_resource_groups.rb