Skip to content

Commit

Permalink
"DynamicIops Model support added (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
anuragsharma-123 authored Oct 22, 2024
1 parent a939947 commit 0be2d44
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [3.16.1] - 2024-10-22
### Added
- "Delete Volume in a Stateful Instance" API support added in the AWS Elastigroup Client.
- Added `DynamicIops` model for AWS Elastigroup.

## [3.16.0] - 2024-10-21
### Added
- Import EC2 instance API support added in the AWS Elastigroup Client.
Expand Down
19 changes: 19 additions & 0 deletions docs/clients/elastigroup/elastigroup_aws_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,25 @@ __Returns__

`(Object)`: Elastigroup API response

<h2 id="spotinst_sdk2.clients.elastigroup.ElastigroupAwsClient.delete_volume_in_stateful_instance">delete_volume_in_stateful_instance</h2>

```python
ElastigroupAwsClient.delete_volume_in_stateful_instance(
group_id, stateful_instance_id, volume_id)
```

Delete stateful instance

__Arguments__

- __group_id (String)__: Elastigroup ID
- __stateful_instance_id (String)__: Stateful Instance ID
- __volume_id (String)__: Volume ID

__Returns__

`(Object)`: Elastigroup API response

<h2 id="spotinst_sdk2.clients.elastigroup.ElastigroupAwsClient.beanstalk_maintenance_status">beanstalk_maintenance_status</h2>

```python
Expand Down
17 changes: 17 additions & 0 deletions docs/models/elastigroup/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,7 @@ EBS(self,
volume_type='d3043820717d74d9a17694c176d39733',
kms_key_id='d3043820717d74d9a17694c176d39733',
dynamic_volume_size='d3043820717d74d9a17694c176d39733',
dynamic_iops='d3043820717d74d9a17694c176d39733',
throughput='d3043820717d74d9a17694c176d39733')
```

Expand All @@ -1234,6 +1235,7 @@ __Arguments__
- __volume_type__: str
- __kms_key_id__: str
- __dynamic_volume_size__: DynamicVolumeSize
- __dynamic_iops__: DynamicIops
- __throughput__: int

<h2 id="spotinst_sdk2.models.elastigroup.aws.DynamicVolumeSize">DynamicVolumeSize</h2>
Expand All @@ -1252,6 +1254,21 @@ __Arguments__
- __resource__: str
- __size_per_resource_unit__: int

<h2 id="spotinst_sdk2.models.elastigroup.aws.DynamicIops">DynamicIops</h2>

```python
DynamicIops(self,
base_size='d3043820717d74d9a17694c176d39733',
resource='d3043820717d74d9a17694c176d39733',
size_per_resource_unit='d3043820717d74d9a17694c176d39733')
```

__Arguments__

- __base_size__: int
- __resource__: str
- __size_per_resource_unit__: int

<h2 id="spotinst_sdk2.models.elastigroup.aws.Tag">Tag</h2>

```python
Expand Down
23 changes: 23 additions & 0 deletions spotinst_sdk2/clients/elastigroup/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -803,6 +803,28 @@ def pause_stateful_instance(self, group_id, stateful_instance_id):

return formatted_response["response"]

def delete_volume_in_stateful_instance(self, group_id, stateful_instance_id, volume_id):
"""
Delete stateful instance
# Arguments
group_id (String): Elastigroup ID
stateful_instance_id (String): Stateful Instance ID
volume_id (String): Volume ID
# Returns
(Object): Elastigroup API response
"""
return self.send_delete(
url=self.__base_elastigroup_url +
"/" +
str(group_id) +
"/statefulInstance/" +
str(stateful_instance_id) +
"/volume/" +
str(volume_id),
entity_name='delete volume in stateful instance')

def beanstalk_maintenance_status(self, group_id):
"""
Beanstalk maintenance status
Expand Down Expand Up @@ -1478,6 +1500,7 @@ def delete_stateful_import(self, stateful_migration_id):
formatted_response = self.convert_json(
content, self.camel_to_underscore)
return formatted_response

# endregion


Expand Down
22 changes: 22 additions & 0 deletions spotinst_sdk2/models/elastigroup/aws/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,7 @@ class EBS:
volume_type: str
kms_key_id: str
dynamic_volume_size: DynamicVolumeSize
dynamic_iops: DynamicIops
throughput: int
"""

Expand All @@ -1460,6 +1461,7 @@ def __init__(
volume_type=none,
kms_key_id=none,
dynamic_volume_size=none,
dynamic_iops=none,
throughput=none):

self.delete_on_termination = delete_on_termination
Expand All @@ -1470,6 +1472,7 @@ def __init__(
self.volume_type = volume_type
self.kms_key_id = kms_key_id
self.dynamic_volume_size = dynamic_volume_size
self.dynamic_iops = dynamic_iops
self.throughput = throughput


Expand All @@ -1492,6 +1495,25 @@ def __init__(
self.size_per_resource_unit = size_per_resource_unit


class DynamicIops:
"""
# Arguments
base_size: int
resource: str
size_per_resource_unit: int
"""

def __init__(
self,
base_size=none,
resource=none,
size_per_resource_unit=none):

self.base_size = base_size
self.resource = resource
self.size_per_resource_unit = size_per_resource_unit


class Tag:
"""
# Arguments
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.16.0'
__version__ = '3.16.1'

0 comments on commit 0be2d44

Please sign in to comment.