Sha256: 084c8154f4af0d64a16bbbd9aa048b2f8d2889339847cc402b381a6cd4ef4fb9

Contents?: true

Size: 809 Bytes

Versions: 1

Compression:

Stored size: 809 Bytes

Contents

module Fog
  module Sql
    class AzureRM
      # Sql Server Collection for Server Service
      class SqlServers < Fog::Collection
        attribute :resource_group
        model Fog::Sql::AzureRM::SqlServer

        def all
          requires :resource_group

          servers = []
          service.list_sql_servers(resource_group).each do |server|
            servers << Fog::Sql::AzureRM::SqlServer.parse(server)
          end
          load(servers)
        end

        def get(resource_group, server_name)
          server = service.get_sql_server(resource_group, server_name)
          server_fog = Fog::Sql::AzureRM::SqlServer.new(service: service)
          server_fog.merge_attributes(Fog::Sql::AzureRM::SqlServer.parse(server))
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fog-azure-rm-0.1.1 lib/fog/azurerm/models/sql/sql_servers.rb