Sha256: 67e7ae25ac154f7419bb2f71e97f3c1e4f63feca5ef42bfca010bdfb31bfffb2

Contents?: true

Size: 740 Bytes

Versions: 39

Compression:

Stored size: 740 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

39 entries across 37 versions & 5 rubygems

Version Path
fog-1.30.0 lib/fog/bluebox/models/compute/servers.rb
fog-1.29.0 lib/fog/bluebox/models/compute/servers.rb
fog-1.28.0 lib/fog/bluebox/models/compute/servers.rb
fog-1.27.0 lib/fog/bluebox/models/compute/servers.rb
fog-1.26.0 lib/fog/bluebox/models/compute/servers.rb
fog-1.25.0 lib/fog/bluebox/models/compute/servers.rb
nsidc-fog-1.24.1 lib/fog/bluebox/models/compute/servers.rb
fog-1.24.0 lib/fog/bluebox/models/compute/servers.rb
ns-fog-1.22.11 lib/fog/bluebox/models/compute/servers.rb
ns-fog-1.22.10 lib/fog/bluebox/models/compute/servers.rb
ns-fog-1.22.9 lib/fog/bluebox/models/compute/servers.rb
ns-fog-1.22.8 lib/fog/bluebox/models/compute/servers.rb
ns-fog-1.22.7 lib/fog/bluebox/models/compute/servers.rb
ns-fog-1.22.6 lib/fog/bluebox/models/compute/servers.rb
fog-1.23.0 lib/fog/bluebox/models/compute/servers.rb
ns-fog-1.22.4 lib/fog/bluebox/models/compute/servers.rb
ns-fog-1.22.3 lib/fog/bluebox/models/compute/servers.rb
ns-fog-1.22.2 lib/fog/bluebox/models/compute/servers.rb
fog-1.22.1 lib/fog/bluebox/models/compute/servers.rb