Class: Fog::Compute::Joyent::Servers

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/joyent/models/compute/servers.rb

Instance Method Summary collapse

Instance Method Details

#allObject



10
11
12
# File 'lib/fog/joyent/models/compute/servers.rb', line 10

def all
  load(service.list_machines().body)
end

#bootstrap(new_attributes = {}) ⇒ Object



20
21
22
23
24
# File 'lib/fog/joyent/models/compute/servers.rb', line 20

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

#create(params = {}) ⇒ Object



14
15
16
17
18
# File 'lib/fog/joyent/models/compute/servers.rb', line 14

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

#get(machine_id) ⇒ Object



26
27
28
29
30
31
# File 'lib/fog/joyent/models/compute/servers.rb', line 26

def get(machine_id)
  data = service.get_machine(machine_id).body
  server = new(data)
  server.tags = server.list_tags if server.tags.nil?
  server
end