dockercloud
This commit is contained in:
parent
86f4a232ff
commit
2d9586a8a1
41 changed files with 2701 additions and 2 deletions
22
dockercloud/api/nodecluster.py
Normal file
22
dockercloud/api/nodecluster.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
from __future__ import absolute_import
|
||||
|
||||
from .base import Mutable, Taggable
|
||||
from .noderegion import Region
|
||||
from .nodetype import NodeType
|
||||
|
||||
|
||||
class NodeCluster(Mutable, Taggable):
|
||||
subsystem = "infra"
|
||||
endpoint = "/nodecluster"
|
||||
|
||||
def deploy(self, tag=None):
|
||||
return self._perform_action("deploy")
|
||||
|
||||
@classmethod
|
||||
def create(cls, **kwargs):
|
||||
for key, value in kwargs.items():
|
||||
if key == "node_type" and isinstance(value, NodeType):
|
||||
kwargs[key] = getattr(value, "resource_uri", "")
|
||||
if key == "region" and isinstance(value, Region):
|
||||
kwargs[key] = getattr(value, "resource_uri", "")
|
||||
return cls(**kwargs)
|
||||
Loading…
Add table
Add a link
Reference in a new issue