Skip to content

Commit

Permalink
Implementation on Python SDK (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramrutha497 authored Feb 24, 2025
1 parent 554dca5 commit 27d27f4
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
43 changes: 42 additions & 1 deletion spotinst_sdk2/models/ocean/gcp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand All @@ -127,6 +143,8 @@ def __init__(
self.maximum = maximum
self.minimum = minimum
self.target = target


# endregion


Expand Down Expand Up @@ -399,6 +417,8 @@ def __init__(
self.launch_specification = launch_specification
self.network_interfaces = network_interfaces
self.subnet_name = subnet_name


# endregion


Expand All @@ -417,6 +437,8 @@ def __init__(
):
self.cluster_name = cluster_name
self.master_location = master_location


# endregion


Expand Down Expand Up @@ -506,6 +528,8 @@ def __init__(
tasks: List[Tasks] = none):
self.shutdown_hours = shutdown_hours
self.tasks = tasks


# endregion


Expand All @@ -532,6 +556,8 @@ def __init__(
self,
container_image: ContainerImage = none):
self.container_image = container_image


# endregion


Expand Down Expand Up @@ -561,6 +587,8 @@ def __init__(
self.preemptible_percentage = preemptible_percentage
self.provisioning_model = provisioning_model
self.should_utilize_commitments = should_utilize_commitments


# endregion


Expand All @@ -569,6 +597,7 @@ class Ocean:
"""
# Arguments
auto_scaler: AutoScaler
auto_update: AutoUpdate
capacity: Capacity
compute: Compute
controller_cluster_id: str
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -600,6 +631,8 @@ def __init__(
self.scheduling = scheduling
self.security = security
self.strategy = strategy


# endregion


Expand All @@ -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


Expand Down Expand Up @@ -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


Expand All @@ -682,7 +719,7 @@ class AllMatch:

def __init__(
self,
all_match: List[Attribute] = none):
all_match: List[Attribute] = none):
self.all_match = all_match


Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -959,6 +998,8 @@ def __init__(
self.strategy = strategy
self.tags = tags
self.taints = taints


# endregion


Expand Down
2 changes: 1 addition & 1 deletion spotinst_sdk2/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '3.21.1'
__version__ = '3.21.2'

0 comments on commit 27d27f4

Please sign in to comment.