From 291ce08285cc99a2b35dd82532eb7650763e8d0a Mon Sep 17 00:00:00 2001 From: adityas1netapp Date: Wed, 26 Jun 2024 14:30:11 +0530 Subject: [PATCH] SPOTAUT-19160-make-application_min_threshold-application_boundaries-application_overhead_values-optional --- spotinst_sdk2/clients/ocean/__init__.py | 6 +++--- spotinst_sdk2/models/ocean/rightsizing/__init__.py | 9 ++++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/spotinst_sdk2/clients/ocean/__init__.py b/spotinst_sdk2/clients/ocean/__init__.py index 98df4870..d8b6941b 100644 --- a/spotinst_sdk2/clients/ocean/__init__.py +++ b/spotinst_sdk2/clients/ocean/__init__.py @@ -2484,9 +2484,9 @@ class OceanRightSizingClient(Client): def create_right_sizing_rule(self, ocean_id: str, rule_name: str, restart_pods: bool, application_intervals: List[right_sizing_ocean.RecommendationApplicationInterval], - application_min_threshold: right_sizing_ocean.RecommendationApplicationMinThreshold, - application_boundaries: right_sizing_ocean.RecommendationApplicationBoundaries, - application_overhead_values: right_sizing_ocean.RecommendationApplicationOverheadValues): + application_min_threshold: right_sizing_ocean.RecommendationApplicationMinThreshold = None, + application_boundaries: right_sizing_ocean.RecommendationApplicationBoundaries = None, + application_overhead_values: right_sizing_ocean.RecommendationApplicationOverheadValues = None): """ Create a right sizing rule for an Ocean cluster. diff --git a/spotinst_sdk2/models/ocean/rightsizing/__init__.py b/spotinst_sdk2/models/ocean/rightsizing/__init__.py index ef0a41a5..2e4af6df 100644 --- a/spotinst_sdk2/models/ocean/rightsizing/__init__.py +++ b/spotinst_sdk2/models/ocean/rightsizing/__init__.py @@ -300,9 +300,12 @@ def __init__(self, self.rule_name = rule_name self.restart_pods = restart_pods self.recommendation_application_intervals = recommendation_application_intervals - self.recommendation_application_min_threshold = recommendation_application_min_threshold - self.recommendation_application_boundaries = recommendation_application_boundaries - self.recommendation_application_overhead_values = recommendation_application_overhead_values + if recommendation_application_min_threshold is not None: + self.recommendation_application_min_threshold = recommendation_application_min_threshold + if recommendation_application_boundaries is not None: + self.recommendation_application_boundaries = recommendation_application_boundaries + if recommendation_application_overhead_values is not None: + self.recommendation_application_overhead_values = recommendation_application_overhead_values def toJSON(self): return json.dumps(self, default=lambda o: o.__dict__,