Skip to content

Commit d988fb5

Browse files
authored
Merge pull request #3 from rling-equinix/rui_develop
sshInterfaceId for primary and secondary device in self configured devices
2 parents fe38d86 + 49a6765 commit d988fb5

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
*.dll
55
*.so
66
*.dylib
7+
.idea
8+
*.iml
79

810
# Test binary, built with `go test -c`
911
*.test

client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ type Device struct {
251251
InterfaceCount *int
252252
CoreCount *int
253253
IsSelfManaged *bool
254+
WanInterfaceId *string
254255
Interfaces []DeviceInterface
255256
VendorConfiguration map[string]string
256257
UserPublicKey *DeviceUserPublicKey

internal/api/device.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type Device struct {
3232
InterfaceCount *int `json:"interfaceCount,omitempty"`
3333
Core *DeviceCoreInformation `json:"core,omitempty"`
3434
DeviceManagementType *string `json:"deviceManagementType,omitempty"`
35+
SshInterfaceId *string `json:"sshInterfaceId,omitempty"`
3536
Interfaces []DeviceInterface `json:"interfaces,omitempty"`
3637
VendorConfig map[string]string `json:"vendorConfig,omitempty"`
3738
UserPublicKey *DeviceUserPublicKey `json:"userPublicKey,omitempty"`
@@ -59,6 +60,7 @@ type DeviceRequest struct {
5960
Version *string `json:"version,omitempty"`
6061
InterfaceCount *int `json:"interfaceCount,omitempty"`
6162
DeviceManagementType *string `json:"deviceManagementType,omitempty"`
63+
SshInterfaceId *string `json:"sshInterfaceId,omitempty"`
6264
Core *int `json:"core,omitempty"`
6365
AdditionalBandwidth *int `json:"additionalBandwidth,omitempty,string"`
6466
ACLTemplateUUID *string `json:"aclTemplateUuid,omitempty"`
@@ -77,6 +79,7 @@ type SecondaryDeviceRequest struct {
7779
HostNamePrefix *string `json:"hostNamePrefix,omitempty"`
7880
AccountNumber *string `json:"accountNumber,omitempty"`
7981
AdditionalBandwidth *int `json:"additionalBandwidth,omitempty,string"`
82+
SshInterfaceId *string `json:"sshInterfaceId,omitempty"`
8083
ACLTemplateUUID *string `json:"aclTemplateUuid,omitempty"`
8184
VendorConfig map[string]string `json:"vendorConfig,omitempty"`
8285
UserPublicKey *DeviceUserPublicKeyRequest `json:"userPublicKey,omitempty"`

rest_device.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ func mapDeviceAPIToDomain(apiDevice api.Device) *Device {
207207
device.RedundantUUID = apiDevice.RedundantUUID
208208
device.TermLength = apiDevice.TermLength
209209
device.AdditionalBandwidth = apiDevice.AdditionalBandwidth
210+
device.WanInterfaceId = apiDevice.SshInterfaceId
210211
device.OrderReference = apiDevice.OrderReference
211212
device.InterfaceCount = apiDevice.InterfaceCount
212213
if apiDevice.Core != nil {
@@ -301,6 +302,7 @@ func createDeviceRequest(device Device) api.DeviceRequest {
301302
}
302303
req.Core = device.CoreCount
303304
req.AdditionalBandwidth = device.AdditionalBandwidth
305+
req.SshInterfaceId = device.WanInterfaceId
304306
req.ACLTemplateUUID = device.ACLTemplateUUID
305307
req.VendorConfig = device.VendorConfiguration
306308
req.UserPublicKey = mapDeviceUserPublicKeyDomainToAPI(device.UserPublicKey)
@@ -318,6 +320,10 @@ func createRedundantDeviceRequest(primary Device, secondary Device) api.DeviceRe
318320
secReq.HostNamePrefix = secondary.HostName
319321
secReq.AccountNumber = secondary.AccountNumber
320322
secReq.AdditionalBandwidth = secondary.AdditionalBandwidth
323+
secReq.SshInterfaceId = secondary.WanInterfaceId
324+
if secReq.SshInterfaceId == nil {
325+
secReq.SshInterfaceId = req.SshInterfaceId
326+
}
321327
secReq.ACLTemplateUUID = secondary.ACLTemplateUUID
322328
secReq.VendorConfig = secondary.VendorConfiguration
323329
secReq.UserPublicKey = mapDeviceUserPublicKeyDomainToAPI(secondary.UserPublicKey)

0 commit comments

Comments
 (0)