Sha256: 1707a3dbc5a12897ddb412ca81036b516bdaddd951b264f1af08d432482fb70b

Contents?: true

Size: 849 Bytes

Versions: 2

Compression:

Stored size: 849 Bytes

Contents

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

        def all
          requires :resource_group
          requires :server_name

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

        def get(resource_group, server_name, name)
          database = service.get_database(resource_group, server_name, name)
          database_obj = SqlDatabase.new(service: service)
          database_obj.merge_attributes(SqlDatabase.parse(database))
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.0 lib/fog/azurerm/models/sql/sql_databases.rb
fog-azure-rm-0.0.9 lib/fog/azurerm/models/sql/sql_databases.rb