Sha256: 642b31294d62416f5e257cf48b7f14aafef9045f88af38dc2493121cb187a50e

Contents?: true

Size: 1.01 KB

Versions: 46

Compression:

Stored size: 1.01 KB

Contents

module Fog
  module Sql
    class AzureRM
      # Sql Server Collection for Database Service
      class SqlDatabases < Fog::Collection
        attribute :resource_group
        attribute :server_name
        model Fog::Sql::AzureRM::SqlDatabase

        def all
          requires :resource_group, :server_name

          databases = []
          service.list_databases(resource_group, server_name).each do |database|
            databases << Fog::Sql::AzureRM::SqlDatabase.parse(database)
          end
          load(databases)
        end

        def get(resource_group, server_name, name)
          database = service.get_database(resource_group, server_name, name)
          database_fog = Fog::Sql::AzureRM::SqlDatabase.new(service: service)
          database_fog.merge_attributes(Fog::Sql::AzureRM::SqlDatabase.parse(database))
        end

        def check_database_exists(resource_group, server_name, name)
          service.check_database_exists(resource_group, server_name, name)
        end
      end
    end
  end
end

Version data entries

46 entries across 46 versions & 4 rubygems

Version Path
fog-azure-rm-0.4.1 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.4.0 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.3.9 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.3.8 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.3.7 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.3.6 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.3.5 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.3.4 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-temp-0.0.4 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-temp-0.0.3 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.3.3 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-temp-0.0.2 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-temp-0.0.1 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.3.2 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-downgraded-0.3.1 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.3.1 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-downgraded-0.3.0 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.3.0 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.2.7 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.2.6 lib/fog/azurerm/models/sql/sql_databases.rb