From 27d27f4fcdf3ae095f6aadab2e6ece1a807ea7cf Mon Sep 17 00:00:00 2001 From: Amrutha Ramanathan <105342664+ramrutha497@users.noreply.github.com> Date: Mon, 24 Feb 2025 12:54:59 +0530 Subject: [PATCH] Implementation on Python SDK (#198) --- CHANGELOG.md | 4 ++ spotinst_sdk2/models/ocean/gcp/__init__.py | 43 +++++++++++++++++++++- spotinst_sdk2/version.py | 2 +- 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 776b692..acd95b0 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.21.2] - 2025-02-20 +### Added +- Added `AutoUpdate` model for Ocean GKE + ## [3.21.1] - 2024-12-17 ### Fixed - Fixed implementation of `list_right_sizing_rules()` API diff --git a/spotinst_sdk2/models/ocean/gcp/__init__.py b/spotinst_sdk2/models/ocean/gcp/__init__.py index 3358c75..67ddfdc 100644 --- a/spotinst_sdk2/models/ocean/gcp/__init__.py +++ b/spotinst_sdk2/models/ocean/gcp/__init__.py @@ -106,6 +106,22 @@ def __init__( self.is_auto_config = is_auto_config self.is_enabled = is_enabled self.resource_limits = resource_limits + + +# endregion + +# region AutoUpdate +class AutoUpdate: + """ + # Arguments + is_enabled: bool + """ + + def __init__(self, + is_enabled: bool = none): + self.is_enabled = is_enabled + + # endregion @@ -127,6 +143,8 @@ def __init__( self.maximum = maximum self.minimum = minimum self.target = target + + # endregion @@ -399,6 +417,8 @@ def __init__( self.launch_specification = launch_specification self.network_interfaces = network_interfaces self.subnet_name = subnet_name + + # endregion @@ -417,6 +437,8 @@ def __init__( ): self.cluster_name = cluster_name self.master_location = master_location + + # endregion @@ -506,6 +528,8 @@ def __init__( tasks: List[Tasks] = none): self.shutdown_hours = shutdown_hours self.tasks = tasks + + # endregion @@ -532,6 +556,8 @@ def __init__( self, container_image: ContainerImage = none): self.container_image = container_image + + # endregion @@ -561,6 +587,8 @@ def __init__( self.preemptible_percentage = preemptible_percentage self.provisioning_model = provisioning_model self.should_utilize_commitments = should_utilize_commitments + + # endregion @@ -569,6 +597,7 @@ class Ocean: """ # Arguments auto_scaler: AutoScaler + auto_update: AutoUpdate capacity: Capacity compute: Compute controller_cluster_id: str @@ -582,6 +611,7 @@ class Ocean: def __init__( self, auto_scaler: AutoScaler = none, + auto_update: AutoUpdate = none, capacity: Capacity = none, compute: Compute = none, controller_cluster_id: str = none, @@ -592,6 +622,7 @@ def __init__( strategy: Strategy = none ): self.auto_scaler = auto_scaler + self.auto_update = auto_update self.capacity = capacity self.compute = compute self.controller_cluster_id = controller_cluster_id @@ -600,6 +631,8 @@ def __init__( self.scheduling = scheduling self.security = security self.strategy = strategy + + # endregion @@ -611,6 +644,8 @@ def __init__(self, ocean: Ocean): def toJSON(self): return json.dumps(self, default=lambda o: o.__dict__, sort_keys=True, indent=4) + + # endregion @@ -670,6 +705,8 @@ def __init__(self, filter: RightSizingRecommendationFilter = none): def toJSON(self): return json.dumps(self, default=lambda o: o.__dict__, sort_keys=True, indent=4) + + # endregion @@ -682,7 +719,7 @@ class AllMatch: def __init__( self, - all_match: List[Attribute] = none): + all_match: List[Attribute] = none): self.all_match = all_match @@ -757,6 +794,8 @@ def __init__(self, aggregated_cluster_costs: AggregatedClusterCosts = none): def toJSON(self): return json.dumps(self, default=lambda o: o.__dict__, sort_keys=True, indent=4) + + # endregion @@ -959,6 +998,8 @@ def __init__( self.strategy = strategy self.tags = tags self.taints = taints + + # endregion diff --git a/spotinst_sdk2/version.py b/spotinst_sdk2/version.py index 9ad8de9..41589e8 100644 --- a/spotinst_sdk2/version.py +++ b/spotinst_sdk2/version.py @@ -1 +1 @@ -__version__ = '3.21.1' +__version__ = '3.21.2'