summaryrefslogtreecommitdiff
path: root/saharaclient/api/clusters.py
diff options
context:
space:
mode:
authorJeremy Freudberg <jeremyfreudberg@gmail.com>2018-06-12 15:20:24 -0400
committerJeremy Freudberg <jeremyfreudberg@gmail.com>2018-06-12 15:20:24 -0400
commit680d62b7ea8e8db0e99cfecc4dab65a94155010c (patch)
tree08e2552eb1fa85ebe0642a91ddb499dc53ca9e26 /saharaclient/api/clusters.py
parentf117734a98de26581bf053186731faffddda68e6 (diff)
downloadpython-saharaclient-680d62b7ea8e8db0e99cfecc4dab65a94155010c.tar.gz
Reflect change to multiple clusters creation
APIv2 has been experimental; we've made a change to endpoint for the creation of multiple clusters. Change-Id: Idc37b263ceabc9edaf6cab5e24fa83c836edc16d
Diffstat (limited to 'saharaclient/api/clusters.py')
-rw-r--r--saharaclient/api/clusters.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/saharaclient/api/clusters.py b/saharaclient/api/clusters.py
index 1ac5d36..fefad51 100644
--- a/saharaclient/api/clusters.py
+++ b/saharaclient/api/clusters.py
@@ -45,12 +45,12 @@ class ClusterManagerV1(base.ResourceManager):
is_transient, description, cluster_configs,
node_groups, user_keypair_id, anti_affinity,
net_id, count, use_autoconfig, shares,
- is_public, is_protected)
+ is_public, is_protected, api_ver=1.1)
def _do_create(self, data, cluster_template_id, default_image_id,
is_transient, description, cluster_configs, node_groups,
user_keypair_id, anti_affinity, net_id, count,
- use_autoconfig, shares, is_public, is_protected):
+ use_autoconfig, shares, is_public, is_protected, api_ver):
# Checking if count is greater than 1, otherwise we set it to None
# so the created dict in the _copy_if_defined method does not contain
@@ -75,7 +75,10 @@ class ClusterManagerV1(base.ResourceManager):
is_protected=is_protected)
if count:
- return self._create('/clusters/multiple', data)
+ if api_ver >= 2:
+ return self._create('/clusters', data)
+ else:
+ return self._create('/clusters/multiple', data)
return self._create('/clusters', data, 'cluster')
@@ -170,7 +173,7 @@ class ClusterManagerV2(ClusterManagerV1):
is_transient, description, cluster_configs,
node_groups, user_keypair_id, anti_affinity,
net_id, count, use_autoconfig, shares,
- is_public, is_protected)
+ is_public, is_protected, api_ver=2)
def scale(self, cluster_id, scale_object):
"""Scale an existing Cluster.