From 680d62b7ea8e8db0e99cfecc4dab65a94155010c Mon Sep 17 00:00:00 2001 From: Jeremy Freudberg Date: Tue, 12 Jun 2018 15:20:24 -0400 Subject: 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 --- saharaclient/api/clusters.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'saharaclient/api/clusters.py') 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. -- cgit v1.2.1