dockercloud

This commit is contained in:
tifayuki 2016-01-14 13:12:51 +01:00
commit 2d9586a8a1
41 changed files with 2701 additions and 2 deletions

26
dockercloud/api/stack.py Normal file
View file

@ -0,0 +1,26 @@
from __future__ import absolute_import
from .base import Mutable
from .exceptions import ApiError
from .http import send_request
class Stack(Mutable):
subsystem = "app"
endpoint = "/stack"
def start(self):
return self._perform_action("start")
def stop(self):
return self._perform_action("stop")
def redeploy(self, reuse_volumes=True):
params = {'reuse_volumes': reuse_volumes}
return self._perform_action("redeploy", params=params)
def export(self):
if not self._detail_uri:
raise ApiError("You must save the object before performing this operation")
url = "/".join([self._detail_uri, "export"])
return send_request("GET", url, inject_header=False)