diff --git a/CHANGELOG.md b/CHANGELOG.md index b9cd42a1..a73ad517 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [3.12.0] - 2024-08-21 +### Fixed +- Updated new fields for ocean Automatic Rightsizing APIs (beta release. For internal use only). + ## [3.11.0] - 2024-08-21 ### Fixed - Updated new fields for ocean Automatic Rightsizing APIs (beta release. For internal use only). diff --git a/spotinst_sdk2/clients/ocean/__init__.py b/spotinst_sdk2/clients/ocean/__init__.py index 66765b4a..20815d2b 100644 --- a/spotinst_sdk2/clients/ocean/__init__.py +++ b/spotinst_sdk2/clients/ocean/__init__.py @@ -2490,33 +2490,40 @@ def launch_nodes_in_vng(self, ocean_launch_spec_id: str, amount: int): class OceanRightSizingClient(Client): - def create_right_sizing_rule(self, ocean_id: str, rule_name: str, restart_pods: bool, + def create_right_sizing_rule(self, ocean_id: str, rule_name: str, restart_replicas: right_sizing_ocean.RestartReplicas, exclude_preliminary_recommendations: bool, application_intervals: List[right_sizing_ocean.RecommendationApplicationInterval], application_min_threshold: right_sizing_ocean.RecommendationApplicationMinThreshold = None, application_boundaries: right_sizing_ocean.RecommendationApplicationBoundaries = None, - application_overhead_values: right_sizing_ocean.RecommendationApplicationOverheadValues = None): + application_overhead_values: right_sizing_ocean.RecommendationApplicationOverheadValues = None, + application_hpa: right_sizing_ocean.RecommendationApplicationHPA = None): """ Create a right sizing rule for an Ocean cluster. # Arguments ocean_id (String): ID of the Ocean Cluster rule_name (String): Name of the Right Sizing Rule - restart_pods (boolean): Enable to sequentially restart pod batches according to recommendations restart_replicas (RestartReplicas): Restart Replicas exclude_preliminary_recommendations (boolean): Exclude preliminary recommendations application_intervals (List[RecommendationApplicationIntervals]): Recommendation Application Intervals application_min_threshold (RecommendationApplicationMinThreshold): Recommendation Application Min Threshold application_boundaries (RecommendationApplicationBoundaries): Recommendation Application Boundaries application_overhead_values (RecommendationApplicationOverheadValues): Recommendation Application Overhead Values + application_hpa (RecommendationApplicationHPA): Recommendation Application HPA # Returns (Object): Ocean Right Sizing Rule API response """ - right_sizing_rule_request = right_sizing_ocean.CreateRightSizingRuleRequest(rule_name=rule_name, restart_pods=restart_pods, restart_replicas=restart_replicas, exclude_preliminary_recommendations=exclude_preliminary_recommendations, recommendation_application_intervals=application_intervals, - recommendation_application_min_threshold=application_min_threshold, recommendation_application_boundaries=application_boundaries, recommendation_application_overhead_values=application_overhead_values) + right_sizing_rule_request = right_sizing_ocean.CreateRightSizingRuleRequest(rule_name=rule_name, + restart_replicas=restart_replicas, + exclude_preliminary_recommendations=exclude_preliminary_recommendations, + recommendation_application_intervals=application_intervals, + recommendation_application_min_threshold=application_min_threshold, + recommendation_application_boundaries=application_boundaries, + recommendation_application_overhead_values=application_overhead_values, + recommendation_application_hpa=application_hpa) excluded_missing_dict = self.exclude_missing( json.loads(right_sizing_rule_request.toJSON())) @@ -2566,36 +2573,37 @@ def delete_right_sizing_rule(self, ocean_id: str, rule_names: List[str]): def update_right_sizing_rule(self, ocean_id: str, rule_name: str, - restart_pods: bool, restart_replicas: right_sizing_ocean.RestartReplicas, exclude_preliminary_recommendations: bool, - application_intervals: right_sizing_ocean.RecommendationApplicationInterval, + 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_overhead_values: right_sizing_ocean.RecommendationApplicationOverheadValues, + application_hpa: right_sizing_ocean.RecommendationApplicationHPA = None): """ Update a right sizing rule for an Ocean cluster. # Arguments ocean_id (String): ID of the Ocean Cluster rule_name (String): Rightsizing Rule name - restart_pods (Bool): Whether existing pods should be restarted or not. - recommendation_application_intervals (RecommendationApplicationIntervals): Recommendation Application Intervals - recommendation_application_min_threshold (RecommendationApplicationMinThreshold): Recommendation Application Min Threshold - recommendation_application_boundaries (RecommendationApplicationBoundaries): Recommendation Application Boundaries - recommendation_application_overhead_values (RecommendationApplicationOverheadValues): Recommendation Application Overhead Values + restart_replicas (RestartReplicas): Restart Replicas + exclude_preliminary_recommendations (boolean): Exclude preliminary recommendations + application_intervals (RecommendationApplicationIntervals): Recommendation Application Intervals + application_min_threshold (RecommendationApplicationMinThreshold): Recommendation Application Min Threshold + application_boundaries (RecommendationApplicationBoundaries): Recommendation Application Boundaries + application_overhead_values (RecommendationApplicationOverheadValues): Recommendation Application Overhead Values + application_hpa (RecommendationApplicationHPA): Recommendation Application HPA # Returns (Object): Ocean Right Sizing Rule API response """ - right_sizing_rule_request = right_sizing_ocean.UpdateRightSizingRuleRequest( - restart_pods, - restart_replicas, - exclude_preliminary_recommendations, - application_intervals, - application_min_threshold, - application_boundaries, - application_overhead_values) + right_sizing_rule_request = right_sizing_ocean.UpdateRightSizingRuleRequest(restart_replicas=restart_replicas, + exclude_preliminary_recommendations=exclude_preliminary_recommendations, + recommendation_application_intervals=application_intervals, + recommendation_application_min_threshold=application_min_threshold, + recommendation_application_boundaries=application_boundaries, + recommendation_application_overhead_values=application_overhead_values, + recommendation_application_hpa=application_hpa) excluded_missing_dict = self.exclude_missing( json.loads(right_sizing_rule_request.toJSON())) diff --git a/spotinst_sdk2/models/ocean/rightsizing/__init__.py b/spotinst_sdk2/models/ocean/rightsizing/__init__.py index 430a00fa..52086ecd 100644 --- a/spotinst_sdk2/models/ocean/rightsizing/__init__.py +++ b/spotinst_sdk2/models/ocean/rightsizing/__init__.py @@ -193,8 +193,24 @@ def __init__( self.memory_percentage = memory_percentage # endregion -# region Label +# region RecommendationApplicationHPA +class RecommendationApplicationHPA: + """ + # Arguments + allow_h_p_a_recommendations: bool + """ + + def __init__( + self, + allow_h_p_a_recommendations: bool = none, + ): + self.allow_h_p_a_recommendations = allow_h_p_a_recommendations + +# endregion + + +# region Label class Label: """ @@ -236,6 +252,7 @@ def __init__( # endregion + # region Namespace @@ -298,21 +315,21 @@ class RestartReplicas(Enum): class CreateRightSizingRuleRequest: def __init__(self, rule_name: str, - restart_pods: bool, restart_replicas: RestartReplicas, exclude_preliminary_recommendations: bool, recommendation_application_intervals: List[RecommendationApplicationInterval], recommendation_application_min_threshold: RecommendationApplicationMinThreshold, recommendation_application_boundaries: RecommendationApplicationBoundaries, - recommendation_application_overhead_values: RecommendationApplicationOverheadValues): + recommendation_application_overhead_values: RecommendationApplicationOverheadValues, + recommendation_application_hpa: RecommendationApplicationHPA): self.rule_name = rule_name - self.restart_pods = restart_pods self.restart_replicas = restart_replicas self.exclude_preliminary_recommendations = exclude_preliminary_recommendations 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 + self.recommendation_application_h_p_a = recommendation_application_hpa def toJSON(self): return json.dumps(self, default=lambda o: o.__dict__, @@ -330,20 +347,20 @@ def toJSON(self): class UpdateRightSizingRuleRequest: def __init__(self, - restart_pods: bool, restart_replicas: RestartReplicas, exclude_preliminary_recommendations: bool, recommendation_application_intervals: List[RecommendationApplicationInterval], - recommendation_application_threshold: RecommendationApplicationMinThreshold, + recommendation_application_min_threshold: RecommendationApplicationMinThreshold, recommendation_application_boundaries: RecommendationApplicationBoundaries, - recommendation_application_overhead_values: RecommendationApplicationOverheadValues): - self.restart_pods = restart_pods + recommendation_application_overhead_values: RecommendationApplicationOverheadValues, + recommendation_application_hpa: RecommendationApplicationHPA): self.restart_replicas = restart_replicas self.exclude_preliminary_recommendations = exclude_preliminary_recommendations self.recommendation_application_intervals = recommendation_application_intervals - self.recommendation_application_threshold = recommendation_application_threshold + 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 + self.recommendation_application_h_p_a = recommendation_application_hpa def toJSON(self): return json.dumps(self, default=lambda o: o.__dict__, diff --git a/spotinst_sdk2/version.py b/spotinst_sdk2/version.py index b8b2efb8..447562b9 100644 --- a/spotinst_sdk2/version.py +++ b/spotinst_sdk2/version.py @@ -1 +1 @@ -__version__ = '3.11.0' +__version__ = '3.12.0'