Files

Class/Module Index [+]

Quicksearch

Fog::Compute::Brightbox::Server

Public Class Methods

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

Public Instance Methods

activate_console() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 130
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/brightbox/models/compute/server.rb, line 94
def destroy
  requires :identity
  connection.destroy_server(identity)
  true
end
flavor() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 100
def flavor
  requires :flavor_id
  connection.flavors.get(flavor_id)
end
flavor_id() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 51
def flavor_id
  if t_flavour_id = attributes[:flavor_id]
    t_flavour_id
  elsif server_type
    server_type[:id] || server_type['id']
  end
end
flavor_id=(incoming_flavour_id) click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 63
def flavor_id=(incoming_flavour_id)
  attributes[:flavor_id] = incoming_flavour_id
end
image() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 105
def image
  requires :image_id
  connection.images.get(image_id)
end
private_ip_address() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 110
def private_ip_address
  unless interfaces.empty?
    interfaces.first["ipv4_address"]
  else
    nil
  end
end
public_ip_address() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 118
def public_ip_address
  unless cloud_ips.empty?
    cloud_ips.first["public_ip"]
  else
    nil
  end
end
ready?() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 126
def ready?
  self.state == 'active'
end
reboot() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 72
def reboot
  false
end
save() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 136
def save
  raise Fog::Errors::Error.new('Resaving an existing object may create a duplicate') if identity
  requires :image_id
  options = {
    :image => image_id,
    :name => name,
    :zone => zone_id,
    :user_data => user_data,
    :server_groups => server_groups
  }.delete_if {|k,v| v.nil? || v == "" }
  unless flavor_id.nil? || flavor_id == ""
    options.merge!(:server_type => flavor_id)
  end
  data = connection.create_server(options)
  merge_attributes(data)
  true
end
shutdown() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 88
def shutdown
  requires :identity
  connection.shutdown_server(identity)
  true
end
snapshot() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 67
def snapshot
  requires :identity
  connection.snapshot_server(identity)
end
start() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 76
def start
  requires :identity
  connection.start_server(identity)
  true
end
stop() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 82
def stop
  requires :identity
  connection.stop_server(identity)
  true
end
zone_id() click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 43
def zone_id
  if t_zone_id = attributes[:zone_id]
    t_zone_id
  elsif zone
    zone[:id] || zone['id']
  end
end
zone_id=(incoming_zone_id) click to toggle source
# File lib/fog/brightbox/models/compute/server.rb, line 59
def zone_id=(incoming_zone_id)
  attributes[:zone_id] = incoming_zone_id
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.