Sha256: b88f6e9baa25190a3ea930deb5c33948ba1dfb34c7d927ffcb2ac59b94ee727c

Contents?: true

Size: 1.45 KB

Versions: 46

Compression:

Stored size: 1.45 KB

Contents

module Fog
  module Sql
    class AzureRM
      # Real class for Sql Database Request
      class Real
        def get_database(resource_group, server_name, name)
          msg = "Getting Sql Database: #{name} in Resource Group: #{resource_group}."
          Fog::Logger.debug msg

          begin
            database = @sql_mgmt_client.databases.get(resource_group, server_name, name)
          rescue MsRestAzure::AzureOperationError => e
            raise_azure_exception(e, msg)
          end
          Fog::Logger.debug "Sql Database fetched successfully in Resource Group: #{resource_group}"
          database
        end
      end

      # Mock class for Sql Database Request
      class Mock
        def get_database(*)
          {
            'location' => '{database-location}',
            'properties' => {
              'createMode' => '{creation-mode}',
              'sourceDatabaseId' => '{source-database-id}',
              'edition' => '{database-edition}',
              'collation' => '{collation-name}',
              'maxSizeBytes' => '{max-database-size}',
              'requestedServiceObjectiveId' => '{requested-service-id}',
              'requestedServiceObjectiveName' => '{requested-service-id}',
              'restorePointInTime' => '{restore-time}',
              'sourceDatabaseDeletionDate' => '{source-deletion-date}',
              'elasticPoolName' => '{elastic-pool-name}'
            }
          }
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 4 rubygems

Version Path
fog-azure-rm-0.2.5 lib/fog/azurerm/requests/sql/get_database.rb
fog-azure-rm-0.2.4 lib/fog/azurerm/requests/sql/get_database.rb
fog-azure-rm-0.2.3 lib/fog/azurerm/requests/sql/get_database.rb
fog-azure-rm-0.2.2 lib/fog/azurerm/requests/sql/get_database.rb
fog-azure-rm-0.2.1 lib/fog/azurerm/requests/sql/get_database.rb
fog-azure-rm-0.2.0 lib/fog/azurerm/requests/sql/get_database.rb