Class: DockerCloud::StackAPI
- Inherits:
-
API
- Object
- API
- DockerCloud::StackAPI
show all
- Defined in:
- lib/docker_cloud/api/stack_api.rb
Constant Summary
collapse
- TYPE =
'Stack'.freeze
Constants inherited
from API
API::API_VERSION, API::BASE_API_PATH
Instance Attribute Summary
Attributes inherited from API
#client, #headers, #type
Instance Method Summary
collapse
Methods inherited from API
#get_from_uri, #http_delete, #http_get, #http_patch, #http_post, #initialize, #parse, #url
Instance Method Details
#all(params = {}) ⇒ Object
9
10
11
12
|
# File 'lib/docker_cloud/api/stack_api.rb', line 9
def all(params = {})
response = http_get(resource_url, params)
format_object(response, TYPE)
end
|
#create(params) ⇒ Object
19
20
21
22
|
# File 'lib/docker_cloud/api/stack_api.rb', line 19
def create(params)
response = http_post(resource_url, params)
format_object(response, TYPE)
end
|
#export(uuid) ⇒ Object
24
25
26
27
|
# File 'lib/docker_cloud/api/stack_api.rb', line 24
def export(uuid)
url = "#{uuid}/export/"
http_get(resource_url(url))
end
|
#get(uuid) ⇒ Object
14
15
16
17
|
# File 'lib/docker_cloud/api/stack_api.rb', line 14
def get(uuid)
response = http_get(resource_url(uuid))
format_object(response, TYPE)
end
|
#redeploy(uuid) ⇒ Object
44
45
46
47
|
# File 'lib/docker_cloud/api/stack_api.rb', line 44
def redeploy(uuid)
url = "#{uuid}/redeploy/"
http_post(resource_url(url))
end
|
#resource_url(name = '') ⇒ Object
5
6
7
|
# File 'lib/docker_cloud/api/stack_api.rb', line 5
def resource_url(name = '')
"/stack/#{name}"
end
|
#start(uuid) ⇒ Object
39
40
41
42
|
# File 'lib/docker_cloud/api/stack_api.rb', line 39
def start(uuid)
url = "#{uuid}/start/"
http_post(resource_url(url))
end
|
#stop(uuid) ⇒ Object
34
35
36
37
|
# File 'lib/docker_cloud/api/stack_api.rb', line 34
def stop(uuid)
url = "#{uuid}/stop/"
http_post(resource_url(url))
end
|
#terminate(uuid) ⇒ Object
49
50
51
52
|
# File 'lib/docker_cloud/api/stack_api.rb', line 49
def terminate(uuid)
uuid = "#{uuid}/"
http_delete(resource_url(uuid))
end
|
#update(uuid, params) ⇒ Object
29
30
31
32
|
# File 'lib/docker_cloud/api/stack_api.rb', line 29
def update(uuid, params)
response = http_patch(resource_url(uuid), params)
format_object(response, TYPE)
end
|