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.6.0 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.5.3 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.5.2 lib/fog/azurerm/models/sql/sql_databases.rb
far-gem-0.5.6 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.5.1 lib/fog/azurerm/models/sql/sql_databases.rb
far-gem-0.5.5 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.5.0 lib/fog/azurerm/models/sql/sql_databases.rb
far-gem-0.5.4 lib/fog/azurerm/models/sql/sql_databases.rb
far-gem-0.5.3 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.4.9 lib/fog/azurerm/models/sql/sql_databases.rb
far-gem-0.5.2 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.4.8 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.4.7 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.4.6 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.4.5 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-temp-0.0.5 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.4.4 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.4.3 lib/fog/azurerm/models/sql/sql_databases.rb
far-gem-0.5.1 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.4.2 lib/fog/azurerm/models/sql/sql_databases.rb