Module: Smartdc::Api::Machines

Included in:
Client
Defined in:
lib/smartdc/api/machines.rb

Defined Under Namespace

Modules: Metadata, Snapshots, Tags

Instance Method Summary collapse

Instance Method Details

#create_machine(body = {}) ⇒ Object



7
8
9
# File 'lib/smartdc/api/machines.rb', line 7

def create_machine(body={})
  post 'my/machines', body
end

#destroy_machine(id) ⇒ Object



15
16
17
# File 'lib/smartdc/api/machines.rb', line 15

def destroy_machine(id)
  delete 'my/machines/' + id.to_s
end

#machine(id) ⇒ Object



11
12
13
# File 'lib/smartdc/api/machines.rb', line 11

def machine(id)
  get 'my/machines/' + id.to_s
end

#machines(params = {}) ⇒ Object



3
4
5
# File 'lib/smartdc/api/machines.rb', line 3

def machines(params={})
  get 'my/machines', params
end

#reboot_machine(id) ⇒ Object



27
28
29
# File 'lib/smartdc/api/machines.rb', line 27

def reboot_machine(id)
  post 'my/machines/' + id.to_s, {action: :reboot}
end

#resize_machine(id, params = {}) ⇒ Object



31
32
33
34
# File 'lib/smartdc/api/machines.rb', line 31

def resize_machine(id, params={})
  params[:action] = 'resize'
  post 'my/machines/' + id.to_s, params
end

#start_machine(id) ⇒ Object



23
24
25
# File 'lib/smartdc/api/machines.rb', line 23

def start_machine(id)
  post 'my/machines/' + id.to_s, {action: :start}
end

#stop_machine(id) ⇒ Object



19
20
21
# File 'lib/smartdc/api/machines.rb', line 19

def stop_machine(id)
  post 'my/machines/' + id.to_s, {action: :stop}
end