Sha256: 665d418b65e2f0921c2de8e9cac6b18f0533db6c5074d1a709d652e7d1a22c8f

Contents?: true

Size: 1.58 KB

Versions: 47

Compression:

Stored size: 1.58 KB

Contents

module Fog
  module Resources
    class AzureRM
      # This class provides the actual implementation for service calls.
      class Real
        def get_resource_group(resource_group_name)
          msg = "Getting Resource Group #{resource_group_name}"
          Fog::Logger.debug msg
          begin
            resource_group = @rmc.resource_groups.get(resource_group_name)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          Fog::Logger.debug "Getting Resource Group #{resource_group_name} successfully"
          resource_group
        end
      end

      # This class provides the mock implementation for unit tests.
      class Mock
        def get_resource_group(*)
          resource_group =
            {
              '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::ResourceGroup.mapper
          @rmc.deserialize(result_mapper, resource_group, 'result.body')
        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/get_resource_group.rb
fog-azure-rm-0.4.0 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.2.7 lib/fog/azurerm/requests/resources/get_resource_group.rb
fog-azure-rm-0.2.6 lib/fog/azurerm/requests/resources/get_resource_group.rb