From 0c16b923f9f3529edc45784ce5475e05ee28a9ea Mon Sep 17 00:00:00 2001 From: Oscar Cobles Date: Thu, 1 Sep 2022 23:25:38 +0200 Subject: [PATCH] added operating_system field to reinstall action --- devices.go | 5 +++-- devices_test.go | 5 ++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/devices.go b/devices.go index 043a6ff0..3e5e9255 100644 --- a/devices.go +++ b/devices.go @@ -443,8 +443,9 @@ type DeviceDeleteRequest struct { Force bool `json:"force_delete"` } type DeviceReinstallFields struct { - PreserveData bool `json:"preserve_data,omitempty"` - DeprovisionFast bool `json:"deprovision_fast,omitempty"` + OperatingSystem string `json:"operating_system,omitempty"` + PreserveData bool `json:"preserve_data,omitempty"` + DeprovisionFast bool `json:"deprovision_fast,omitempty"` } type DeviceReinstallRequest struct { diff --git a/devices_test.go b/devices_test.go index 4c68e55e..00fe870d 100644 --- a/devices_test.go +++ b/devices_test.go @@ -170,7 +170,10 @@ func TestAccDeviceReinstall(t *testing.T) { waitDeviceActive(t, c, dID) - rf := DeviceReinstallFields{DeprovisionFast: true} + rf := DeviceReinstallFields{ + DeprovisionFast: true, + OperatingSystem: "ubuntu_20_04", + } _, err = c.Devices.Reinstall(dID, &rf) if err != nil {