From 0134b80072a5f751867f9d0ec060ab06f9f7c408 Mon Sep 17 00:00:00 2001 From: Amrutha Ramanathan <105342664+ramrutha497@users.noreply.github.com> Date: Mon, 1 Jul 2024 02:51:10 +0530 Subject: [PATCH] update gke create vng --- spotinst_sdk2/clients/ocean/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spotinst_sdk2/clients/ocean/__init__.py b/spotinst_sdk2/clients/ocean/__init__.py index d8b6941b..e7e953ae 100644 --- a/spotinst_sdk2/clients/ocean/__init__.py +++ b/spotinst_sdk2/clients/ocean/__init__.py @@ -2108,12 +2108,13 @@ def get_aggregated_summary_costs(self, ocean_id: str, aggregated_cluster_costs: return formatted_response["response"]["items"][0] - def create_virtual_node_group(self, vng: gcp_ocean.VirtualNodeGroup): + def create_virtual_node_group(self, vng: gcp_ocean.VirtualNodeGroup, initial_nodes: int = None): """ Create a virtual node group. # Arguments vng (VirtualNodeGroup): VirtualNodeGroup Object + initial_nodes: When set to an integer greater than 0, a corresponding number of nodes will be launched from the virtual node group created. # Returns (Object): Ocean Launch Spec response @@ -2128,10 +2129,13 @@ def create_virtual_node_group(self, vng: gcp_ocean.VirtualNodeGroup): body_json = json.dumps(formatted_missing_dict) - response = self.send_post( + query_params = dict(initialNodes=initial_nodes) + + response = self.send_post_with_params( body=body_json, url=self.__base_ocean_launchspec_url, - entity_name='ocean_gcp_vng') + entity_name='ocean_gcp_vng', + user_query_params=query_params) formatted_response = self.convert_json(response, self.camel_to_underscore)