Sha256: f9604e349e937a80700d37ba4f07a3ed46ab7d2be9554b5b396191483c5d416b

Contents?: true

Size: 582 Bytes

Versions: 11

Compression:

Stored size: 582 Bytes

Contents

module Fog
  module Rackspace
    class Servers

      def servers
        Fog::Rackspace::Servers::Servers.new(:connection => self)
      end

      class Servers < Fog::Collection

        model Fog::Rackspace::Servers::Server

        def all
          data = connection.list_servers_detail.body['servers']
          load(data)
        end

        def get(server_id)
          if server = connection.get_server_details(server_id).body['server']
            new(server)
          end
        rescue Excon::Errors::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fog-0.0.58 lib/fog/rackspace/models/servers/servers.rb
fog-0.0.57 lib/fog/rackspace/models/servers/servers.rb
fog-0.0.56 lib/fog/rackspace/models/servers/servers.rb
fog-0.0.55 lib/fog/rackspace/models/servers/servers.rb
fog-0.0.54 lib/fog/rackspace/models/servers/servers.rb
fog-0.0.53 lib/fog/rackspace/models/servers/servers.rb
fog-0.0.52 lib/fog/rackspace/models/servers/servers.rb
fog-0.0.51 lib/fog/rackspace/models/servers/servers.rb
fog-0.0.50 lib/fog/rackspace/models/servers/servers.rb
fog-0.0.49 lib/fog/rackspace/models/servers/servers.rb
fog-0.0.48 lib/fog/rackspace/models/servers/servers.rb