diff options
author | Jeremy Freudberg <jeremyfreudberg@gmail.com> | 2018-06-12 15:20:24 -0400 |
---|---|---|
committer | Jeremy Freudberg <jeremyfreudberg@gmail.com> | 2018-06-12 15:20:24 -0400 |
commit | 680d62b7ea8e8db0e99cfecc4dab65a94155010c (patch) | |
tree | 08e2552eb1fa85ebe0642a91ddb499dc53ca9e26 | |
parent | f117734a98de26581bf053186731faffddda68e6 (diff) | |
download | python-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
-rw-r--r-- | releasenotes/notes/multiple-clusters-change-69a15f00597739d7.yaml | 4 | ||||
-rw-r--r-- | saharaclient/api/clusters.py | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/releasenotes/notes/multiple-clusters-change-69a15f00597739d7.yaml b/releasenotes/notes/multiple-clusters-change-69a15f00597739d7.yaml new file mode 100644 index 0000000..42fecc9 --- /dev/null +++ b/releasenotes/notes/multiple-clusters-change-69a15f00597739d7.yaml @@ -0,0 +1,4 @@ +--- +other: + - When using APIv2, the creation of multiple clusters simultaneously + now only supports the API behavior of Sahara 9.0.0.0b2 or later. 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. |