Skip to content

Commit 532fd86

Browse files
authored
Merge pull request #77 from grahamc/reinstall
Device.reinstall: support, including different OS / custom iPXE
2 parents c738226 + 4784a23 commit 532fd86

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
55
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.43.0] - 2020-02-24
8+
### Added
9+
- Support for reinstalling the operating system to a device, including changing the operating system.
10+
711
## [1.42.0] - 2020-02-14
812
### Added
913
- Capturing of available_in to Plan

packet/Device.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,18 @@ def update(self):
6565
def delete(self):
6666
return self.manager.call_api("devices/%s" % self.id, type="DELETE")
6767

68+
def reinstall(self, operating_system=None, ipxe_script_url=None):
69+
params = {"type": "reinstall"}
70+
if operating_system is not None:
71+
params["operating_system"] = operating_system
72+
if ipxe_script_url is not None:
73+
params["operating_system"] = "custom_ipxe"
74+
params["ipxe_script_url"] = ipxe_script_url
75+
76+
return self.manager.call_api(
77+
"devices/%s/actions" % self.id, type="POST", params=params
78+
)
79+
6880
def power_off(self):
6981
params = {"type": "power_off"}
7082
return self.manager.call_api(

0 commit comments

Comments
 (0)