Sha256: 2c925316d08ba46953ddeee5906245039887301061fcd2ffe928a8b4ba2b717c

Contents?: true

Size: 744 Bytes

Versions: 65

Compression:

Stored size: 744 Bytes

Contents

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

module Fog
  module Compute
    class Bluebox

      class Servers < Fog::Collection

        model Fog::Compute::Bluebox::Server

        def all
          data = service.get_blocks.body
          load(data)
        end

        def bootstrap(new_attributes = {})
          server = create(new_attributes)
          server.wait_for { ready? }
          server.setup(:key_data => [server.private_key])
          server
        end

        def get(server_id)
          if server_id && server = service.get_block(server_id).body
            new(server)
          end
        rescue Fog::Compute::Bluebox::NotFound
          nil
        end

      end

    end
  end
end

Version data entries

65 entries across 65 versions & 6 rubygems

Version Path
fog-maestrodev-1.15.0.20130927082724 lib/fog/bluebox/models/compute/servers.rb
fog-maestrodev-1.15.0.20130829165835 lib/fog/bluebox/models/compute/servers.rb
fog-1.15.0 lib/fog/bluebox/models/compute/servers.rb
gapinc-fog-1.14.0 lib/fog/bluebox/models/compute/servers.rb
fog-maestrodev-1.14.0.20130806165225 lib/fog/bluebox/models/compute/servers.rb
fog-1.14.0 lib/fog/bluebox/models/compute/servers.rb
fog-1.13.0 lib/fog/bluebox/models/compute/servers.rb
gapinc-fog-1.12.1.2 lib/fog/bluebox/models/compute/servers.rb
gapinc-fog-1.12.1.1 lib/fog/bluebox/models/compute/servers.rb
gapinc-fog-1.12.1a lib/fog/bluebox/models/compute/servers.rb
gapinc-fog-1.12.1 lib/fog/bluebox/models/compute/servers.rb
fog-1.12.1 lib/fog/bluebox/models/compute/servers.rb
fog-1.12.0 lib/fog/bluebox/models/compute/servers.rb
hpfog-0.0.20 lib/fog/bluebox/models/compute/servers.rb
vagrant-shell-0.2.6 vendor/bundle/gems/fog-1.10.1/lib/fog/bluebox/models/compute/servers.rb
vagrant-shell-0.2.5 vendor/bundle/gems/fog-1.10.1/lib/fog/bluebox/models/compute/servers.rb
fog-1.11.1 lib/fog/bluebox/models/compute/servers.rb
fog-1.11.0 lib/fog/bluebox/models/compute/servers.rb
fog-1.10.1 lib/fog/bluebox/models/compute/servers.rb
fog-test-me-1.10.0 lib/fog/bluebox/models/compute/servers.rb