From f98d4f0a9dfadc4810e82c288b3f471d82dead5b Mon Sep 17 00:00:00 2001 From: Sharad Kesarwani <108344822+sharadkesarwani@users.noreply.github.com> Date: Wed, 22 May 2024 10:28:26 +0530 Subject: [PATCH 1/3] Added support for `tasks` under `scheduling` . Added support for `tasks` under `scheduling` . --- spotinst_sdk2/models/ocean/azure/__init__.py | 69 +++++++++++++++++++- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/spotinst_sdk2/models/ocean/azure/__init__.py b/spotinst_sdk2/models/ocean/azure/__init__.py index 25905161..4bc8735b 100644 --- a/spotinst_sdk2/models/ocean/azure/__init__.py +++ b/spotinst_sdk2/models/ocean/azure/__init__.py @@ -119,18 +119,83 @@ def __init__( self.is_enabled = is_enabled self.time_windows = time_windows +class ClusterRoll: + """ + # Arguments + batch_min_healthy_percentage: int + batch_size_percentage: int + comment: str + respect_pdb: bool + respect_restrict_scale_down: bool + vng_ids: List[str] + """ + + def __init__( + self, + batch_min_healthy_percentage: int = none, + batch_size_percentage: int = none, + comment: str = none, + respect_pdb: bool = none, + respect_restrict_scale_down: bool = none, + vng_ids: List[str] = none): + self.batch_min_healthy_percentage = batch_min_healthy_percentage + self.batch_size_percentage = batch_size_percentage + self.comment = comment + self.respect_pdb = respect_pdb + self.respect_restrict_scale_down = respect_restrict_scale_down + self.vng_ids = vng_ids + +class Parameters: + """ + # Arguments + cluster_roll: ClusterRoll + """ + + def __init__( + self, + cluster_roll: ClusterRoll = none): + self.cluster_roll = cluster_roll + +class TaskType(Enum): + cluster_roll = "clusterRoll" + + +# region Task +class Tasks: + """ + # Arguments + cron_expression: str + is_enabled: bool + parameters: Parameters + task_type: TaskType + """ + + def __init__( + self, + cron_expression: str = none, + is_enabled: bool = none, + parameters: Parameters = none, + task_type: TaskType = none): + self.cron_expression = cron_expression + self.is_enabled = is_enabled + self.parameters = parameters + self.task_type = task_type + +# endregion class Scheduling: """ # Arguments shutdown_hours: ShutdownHours + tasks : List[Tasks] """ def __init__( self, - shutdown_hours: ShutdownHours = none): + shutdown_hours: ShutdownHours = none, + tasks: List[Tasks] = none): self.shutdown_hours = shutdown_hours -# endregion + self.tasks = tasks # region Health From 98459edde2d2a4e19a86a0785232e4572e955092 Mon Sep 17 00:00:00 2001 From: Anurag Sharma Date: Wed, 22 May 2024 23:00:13 +0530 Subject: [PATCH 2/3] Adding documentation and requests library version upgrade --- CHANGELOG.md | 4 ++ docs/models/ocean/azure.md | 68 +++++++++++++++++++- requirements.txt | 2 +- spotinst_sdk2/models/ocean/azure/__init__.py | 30 +++++---- 4 files changed, 87 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66e43720..7f10bc93 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.2.0] - 2024-05-22 +### Added +- Added support for `Task` in Ocean AKS `Scheduling` model. + ## [3.1.0] - 2024-05-17 ### Added - Added support for `GpuType` in Ocean AKS `Filters` model. diff --git a/docs/models/ocean/azure.md b/docs/models/ocean/azure.md index e6635b10..e236bfd5 100644 --- a/docs/models/ocean/azure.md +++ b/docs/models/ocean/azure.md @@ -97,17 +97,81 @@ __Arguments__ - __is_enabled__: bool - __time_windows__: List[str] +

ClusterRoll

+ +```python +ClusterRoll( + self, + batch_min_healthy_percentage: int = 'd3043820717d74d9a17694c176d39733', + batch_size_percentage: int = 'd3043820717d74d9a17694c176d39733', + comment: str = 'd3043820717d74d9a17694c176d39733', + respect_pdb: bool = 'd3043820717d74d9a17694c176d39733', + respect_restrict_scale_down: bool = 'd3043820717d74d9a17694c176d39733', + vng_ids: typing.List[str] = 'd3043820717d74d9a17694c176d39733') +``` + +__Arguments__ + +- __batch_min_healthy_percentage__: int +- __batch_size_percentage__: int +- __comment__: str +- __respect_pdb__: bool +- __respect_restrict_scale_down__: bool +- __vng_ids__: List[str] + +

Parameters

+ +```python +Parameters(self, + cluster_roll: ClusterRoll = 'd3043820717d74d9a17694c176d39733' + ) +``` + +__Arguments__ + +- __cluster_roll__: ClusterRoll + +

TaskType

+ +```python +TaskType(cls, value, names=None, *, module, qualname, type, start) +``` +An enumeration. +

cluster_roll

+ + +

Task

+ +```python +Task(self, + cron_expression: str = 'd3043820717d74d9a17694c176d39733', + is_enabled: bool = 'd3043820717d74d9a17694c176d39733', + parameters: Parameters = 'd3043820717d74d9a17694c176d39733', + task_type: TaskType = 'd3043820717d74d9a17694c176d39733') +``` + +__Arguments__ + +- __cron_expression__: str +- __is_enabled__: bool +- __parameters__: Parameters +- __task_type__: TaskType +

Scheduling

```python Scheduling( - self, - shutdown_hours: ShutdownHours = 'd3043820717d74d9a17694c176d39733') + self, + shutdown_hours: ShutdownHours = 'd3043820717d74d9a17694c176d39733', + tasks: + typing.List[spotinst_sdk2.models.ocean.azure.Task] = 'd3043820717d74d9a17694c176d39733' +) ``` __Arguments__ - __shutdown_hours__: ShutdownHours +- __tasks__: List[Task]

Health

diff --git a/requirements.txt b/requirements.txt index 72dbdcdc..fb810e02 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ PyYaml==6.0.1 -requests==2.31.0 +requests==2.32.0 pydoc-markdown==2.1.3 mock==5.1.0 pytest==7.4.4 \ No newline at end of file diff --git a/spotinst_sdk2/models/ocean/azure/__init__.py b/spotinst_sdk2/models/ocean/azure/__init__.py index 4bc8735b..d3aa94ea 100644 --- a/spotinst_sdk2/models/ocean/azure/__init__.py +++ b/spotinst_sdk2/models/ocean/azure/__init__.py @@ -119,6 +119,7 @@ def __init__( self.is_enabled = is_enabled self.time_windows = time_windows + class ClusterRoll: """ # Arguments @@ -145,6 +146,7 @@ def __init__( self.respect_restrict_scale_down = respect_restrict_scale_down self.vng_ids = vng_ids + class Parameters: """ # Arguments @@ -156,12 +158,12 @@ def __init__( cluster_roll: ClusterRoll = none): self.cluster_roll = cluster_roll + class TaskType(Enum): cluster_roll = "clusterRoll" -# region Task -class Tasks: +class Task: """ # Arguments cron_expression: str @@ -181,21 +183,21 @@ def __init__( self.parameters = parameters self.task_type = task_type -# endregion class Scheduling: """ # Arguments shutdown_hours: ShutdownHours - tasks : List[Tasks] + tasks: List[Task] """ def __init__( self, shutdown_hours: ShutdownHours = none, - tasks: List[Tasks] = none): + tasks: List[Task] = none): self.shutdown_hours = shutdown_hours self.tasks = tasks +# endregion # region Health @@ -401,16 +403,16 @@ class VmType(Enum): class GpuType(Enum): - nvidia_tesla_v100 = "nvidia-tesla-v100" + nvidia_tesla_v100 = "nvidia-tesla-v100" amd_radeon_instinct_mi25 = "amd-radeon-instinct-mi25" - nvidia_a10 = "nvidia-a10" - nvidia_tesla_a100 = "nvidia-tesla-a100" - nvidia_tesla_k80 = "nvidia-tesla-k80" - nvidia_tesla_m60 = "nvidia-tesla-m60" - nvidia_tesla_p100 = "nvidia-tesla-p100" - nvidia_tesla_p40 = "nvidia-tesla-p40" - nvidia_tesla_t4 = "nvidia-tesla-t4" - nvidia_tesla_h100 = "nvidia-tesla-h100" + nvidia_a10 = "nvidia-a10" + nvidia_tesla_a100 = "nvidia-tesla-a100" + nvidia_tesla_k80 = "nvidia-tesla-k80" + nvidia_tesla_m60 = "nvidia-tesla-m60" + nvidia_tesla_p100 = "nvidia-tesla-p100" + nvidia_tesla_p40 = "nvidia-tesla-p40" + nvidia_tesla_t4 = "nvidia-tesla-t4" + nvidia_tesla_h100 = "nvidia-tesla-h100" class Filters: From fefdc7c04ec1c4bcb15ca37b9e1772c27d39e86e Mon Sep 17 00:00:00 2001 From: Anurag Sharma Date: Thu, 23 May 2024 10:31:15 +0530 Subject: [PATCH 3/3] Correcting version number --- CHANGELOG.md | 4 ++-- spotinst_sdk2/version.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7f10bc93..ebf63d1c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,11 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [3.2.0] - 2024-05-22 +## [3.3.0] - 2024-05-22 ### Added - Added support for `Task` in Ocean AKS `Scheduling` model. -## [3.1.0] - 2024-05-17 +## [3.2.0] - 2024-05-17 ### Added - Added support for `GpuType` in Ocean AKS `Filters` model. diff --git a/spotinst_sdk2/version.py b/spotinst_sdk2/version.py index 573cf70b..6a157dcb 100644 --- a/spotinst_sdk2/version.py +++ b/spotinst_sdk2/version.py @@ -1 +1 @@ -__version__ = '3.2.0' +__version__ = '3.3.0'