Skip to content

Commit 04fd393

Browse files
authored
feat: add support for purchaseOrderNumber attribute in secondary device (#38)
1 parent ac47522 commit 04fd393

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

internal/api/device.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ type SecondaryDeviceRequest struct {
102102
MgmtAclTemplateUUID *string `json:"mgmtAclTemplateUuid,omitempty"`
103103
VendorConfig map[string]string `json:"vendorConfig,omitempty"`
104104
UserPublicKey *DeviceUserPublicKeyRequest `json:"userPublicKey,omitempty"`
105+
PurchaseOrderNumber *string `json:"purchaseOrderNumber,omitempty"`
105106
}
106107

107108
// DeviceInterface describes device network interface

rest_device.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ func createRedundantDeviceRequest(primary Device, secondary Device) api.DeviceRe
446446
secReq.Notifications = secondary.Notifications
447447
secReq.HostNamePrefix = secondary.HostName
448448
secReq.AccountNumber = secondary.AccountNumber
449+
secReq.PurchaseOrderNumber = secondary.PurchaseOrderNumber
449450
secReq.AdditionalBandwidth = secondary.AdditionalBandwidth
450451
secReq.SshInterfaceID = secondary.WanInterfaceId
451452
if secReq.SshInterfaceID == nil {

rest_device_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ func TestCreateRedundantDevice(t *testing.T) {
161161
Notifications: []string{"secondary@secondary.com"},
162162
HostName: String("secondaryHostname"),
163163
AccountNumber: String("99999"),
164+
PurchaseOrderNumber: String("po123"),
164165
AdditionalBandwidth: Int(200),
165166
ACLTemplateUUID: String("4972e8d2-417f-4821-91a8-f4a61a6dcdc3"),
166167
MgmtAclTemplateUuid: String("4972e8d2-417f-4821-91a8-f4a61a6dcdc3"),
@@ -552,6 +553,7 @@ func verifyRedundantDeviceRequest(t *testing.T, primary, secondary Device, req a
552553
assert.ElementsMatch(t, secondary.Notifications, req.Secondary.Notifications, "Secondary Notifications matches")
553554
assert.Equal(t, secondary.HostName, req.Secondary.HostNamePrefix, "Secondary HostName matches")
554555
assert.Equal(t, secondary.AccountNumber, req.Secondary.AccountNumber, "Secondary AccountNumber matches")
556+
assert.Equal(t, secondary.PurchaseOrderNumber, req.Secondary.PurchaseOrderNumber, "Secondary PurchaseOrderNumber matches")
555557
assert.Equal(t, secondary.AdditionalBandwidth, req.Secondary.AdditionalBandwidth, "Secondary AdditionalBandwidth matches")
556558
assert.Equal(t, secondary.ACLTemplateUUID, req.Secondary.ACLTemplateUUID, "Secondary ACLTemplateUUID matches")
557559
assert.Equal(t, secondary.MgmtAclTemplateUuid, req.Secondary.MgmtAclTemplateUUID, "Secondary MgmtAclTemplateUuid matches")

0 commit comments

Comments
 (0)