Skip to content

Commit 4ef9cc6

Browse files
authored
Merge pull request #9 from DataCrunch-io/feature/add-coupon-support
Feature/add coupon support
2 parents 9cbb385 + ab45e73 commit 4ef9cc6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Changelog
22
=========
33

4+
* Added support for adding a coupon code when deploying a new instance
5+
46
v1.0.9 (2022-09-16)
57
-------------------
68

datacrunch/instances/instances.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,8 @@ def create(self,
350350
startup_script_id: str = None,
351351
volumes: List[Dict] = None,
352352
os_volume: Dict = None,
353-
is_spot: bool = False) -> Instance:
353+
is_spot: bool = False,
354+
coupon: str = None) -> Instance:
354355
"""Creates (deploys) a new instance
355356
356357
:param instance_type: instance type. e.g. '8V100.48M'
@@ -373,6 +374,8 @@ def create(self,
373374
:type os_volume: Dict, optional
374375
:param is_spot: Is spot instance
375376
:type is_spot: bool, optional
377+
:param coupon: coupon code
378+
:type is_spot: str, optional
376379
:return: the new instance object
377380
:rtype: id
378381
"""
@@ -386,7 +389,8 @@ def create(self,
386389
"location": location,
387390
"os_volume": os_volume,
388391
"volumes": volumes,
389-
"is_spot": is_spot
392+
"is_spot": is_spot,
393+
"coupon": coupon
390394
}
391395
id = self._http_client.post(INSTANCES_ENDPOINT, json=payload).text
392396
instance = self.get_by_id(id)

0 commit comments

Comments
 (0)