Sha256: 543cfbc8b354c2c2b1da6f40a9be12248fccbdcf95619dc89e1da4fa8043b5ac

Contents?: true

Size: 765 Bytes

Versions: 7

Compression:

Stored size: 765 Bytes

Contents

require 'fog/core/collection'
require 'fog/joyent/models/compute/server'

module Fog
  module Compute

    class Joyent
      class Servers < Fog::Collection
        model Fog::Compute::Joyent::Server

        def all
          load(self.connection.list_machines().body)
        end

        def create(params = {})
          data = self.connection.create_machine(params).body
          server = new(data)
          server
        end

        def bootstrap(new_attributes = {})
          server = create(new_attributes)
          server.wait_for { ready? }
          server
        end

        def get(machine_id)
          data = self.connection.get_machine(machine_id).body
          new(data)
        end

      end
    end # Joyent

  end # Compute
end # Fog

Version data entries

7 entries across 7 versions & 5 rubygems

Version Path
fog-nirvanix-1.8.2 lib/fog/joyent/models/compute/servers.rb
fog-nirvanix-1.8.1 lib/fog/joyent/models/compute/servers.rb
ey-vendored-backup-3.0.27 vendor/gems/fog/lib/fog/joyent/models/compute/servers.rb
fog-sgonyea-1.8.1 lib/fog/joyent/models/compute/servers.rb
fog-1.8.0 lib/fog/joyent/models/compute/servers.rb
fog-maestrodev-1.7.0.20121114190951 lib/fog/joyent/models/compute/servers.rb
fog-1.7.0 lib/fog/joyent/models/compute/servers.rb