Class: TutumServices

Inherits:
TutumApi show all
Defined in:
lib/tutum_services.rb

Constant Summary

Constants inherited from TutumApi

TutumApi::API_VERSION, TutumApi::BASE_API_PATH

Instance Attribute Summary

Attributes inherited from TutumApi

#headers

Instance Method Summary collapse

Methods inherited from TutumApi

#http_delete, #http_get, #http_patch, #http_post, #initialize, #url

Constructor Details

This class inherits a constructor from TutumApi

Instance Method Details

#create(params) ⇒ Object



14
15
16
# File 'lib/tutum_services.rb', line 14

def create(params)
  http_post(create_url, params)
end

#create_urlObject



10
11
12
# File 'lib/tutum_services.rb', line 10

def create_url
  "/service/"
end

#get(uuid) ⇒ Object



22
23
24
# File 'lib/tutum_services.rb', line 22

def get(uuid)
  http_get(get_url(uuid))
end

#get_url(uuid) ⇒ Object



18
19
20
# File 'lib/tutum_services.rb', line 18

def get_url(uuid)
  "/service/#{uuid}/"
end

#list(params = {}) ⇒ Object



6
7
8
# File 'lib/tutum_services.rb', line 6

def list(params={})
  http_get(list_url, params)
end

#list_urlObject



2
3
4
# File 'lib/tutum_services.rb', line 2

def list_url
  "/service/"
end

#logs(uuid) ⇒ Object



30
31
32
# File 'lib/tutum_services.rb', line 30

def logs(uuid)
  http_get(logs_url(uuid))
end

#logs_url(uuid) ⇒ Object



26
27
28
# File 'lib/tutum_services.rb', line 26

def logs_url(uuid)
  "/service/#{uuid}/logs/"
end

#redeploy(uuid) ⇒ Object



62
63
64
# File 'lib/tutum_services.rb', line 62

def redeploy(uuid)
  http_post(redeploy_url(uuid))
end

#redeploy_url(uuid) ⇒ Object



58
59
60
# File 'lib/tutum_services.rb', line 58

def redeploy_url(uuid)
  "/service/#{uuid}/redeploy/"
end

#start(uuid) ⇒ Object



46
47
48
# File 'lib/tutum_services.rb', line 46

def start(uuid)
  http_post(start_url(uuid))
end

#start_url(uuid) ⇒ Object



42
43
44
# File 'lib/tutum_services.rb', line 42

def start_url(uuid)
  "/service/#{uuid}/start/"
end

#stop(uuid) ⇒ Object



54
55
56
# File 'lib/tutum_services.rb', line 54

def stop(uuid)
  http_post(stop_url(uuid))
end

#stop_url(uuid) ⇒ Object



50
51
52
# File 'lib/tutum_services.rb', line 50

def stop_url(uuid)
  "/service/#{uuid}/stop/"
end

#terminate(uuid) ⇒ Object



70
71
72
# File 'lib/tutum_services.rb', line 70

def terminate(uuid)
  http_delete(terminate_url(uuid))
end

#terminate_url(uuid) ⇒ Object



66
67
68
# File 'lib/tutum_services.rb', line 66

def terminate_url(uuid)
  "/service/#{uuid}/"
end

#update(uuid, params) ⇒ Object



38
39
40
# File 'lib/tutum_services.rb', line 38

def update(uuid, params)
  http_patch(update_url(uuid), params)
end

#update_url(uuid) ⇒ Object



34
35
36
# File 'lib/tutum_services.rb', line 34

def update_url(uuid)
  "/service/#{uuid}/"
end