Parent

Files

Class/Module Index [+]

Quicksearch

Fog::Compute::Brightbox::Server

Public Class Methods

new(attributes={}) click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 31
def initialize(attributes={})
  self.flavor_id  ||= 'typ-4nssg' # Nano
  self.image_id   ||= 'img-2ab98' # Ubuntu Lucid 10.04 server (i686)
  super
end

Public Instance Methods

activate_console() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 92
def activate_console
  requires :identity
  response = connection.activate_console_server(identity)
  [response["console_url"], response["console_token"], response["console_token_expires"]]
end
destroy() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 64
def destroy
  requires :identity
  connection.destroy_server(identity)
  true
end
flavor() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 70
def flavor
  requires :flavor_id
  connection.flavors.get(flavor_id)
end
image() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 75
def image
  requires :image_id
  connection.images.get(image_id)
end
private_ip_address() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 80
def private_ip_address
  interfaces.first
end
public_ip_address() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 84
def public_ip_address
  cloud_ips.first
end
ready?() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 88
def ready?
  self.state == 'active'
end
reboot() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 42
def reboot
  false
end
save() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 98
def save
  requires :image_id
  options = {
    :image => image_id,
    :server_type => flavor_id,
    :name => name,
    :zone => zone_id,
    :user_data => user_data
  }.delete_if {|k,v| v.nil? || v == "" }
  data = connection.create_server(options)
  merge_attributes(data)
  true
end
shutdown() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 58
def shutdown
  requires :identity
  connection.shutdown_server(identity)
  true
end
snapshot() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 37
def snapshot
  requires :identity
  connection.snapshot_server(identity)
end
start() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 46
def start
  requires :identity
  connection.start_server(identity)
  true
end
stop() click to toggle source
# File lib/fog/compute/models/brightbox/server.rb, line 52
def stop
  requires :identity
  connection.stop_server(identity)
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.