Skip to content

Commit 9fe1e48

Browse files
partner-network-connect: Add redundancy zone. (#840)
Co-authored-by: Weston Carlson <[email protected]>
1 parent 9b99e42 commit 9fe1e48

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

partner_network_connect.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ type PartnerAttachmentCreateRequest struct {
4747
VPCIDs []string `json:"vpc_ids,omitempty"`
4848
// BGP is the BGP configuration of the Partner Attachment
4949
BGP BGP `json:"bgp,omitempty"`
50+
// RedundancyZone is the redundancy zone of the Partner Attachment
51+
RedundancyZone string `json:"redundancy_zone,omitempty"`
5052
}
5153

5254
type partnerAttachmentRequestBody struct {
@@ -62,6 +64,8 @@ type partnerAttachmentRequestBody struct {
6264
VPCIDs []string `json:"vpc_ids,omitempty"`
6365
// BGP is the BGP configuration of the Partner Attachment
6466
BGP *BGPInput `json:"bgp,omitempty"`
67+
// RedundancyZone is the redundancy zone of the Partner Attachment
68+
RedundancyZone string `json:"redundancy_zone,omitempty"`
6569
}
6670

6771
func (req *PartnerAttachmentCreateRequest) buildReq() *partnerAttachmentRequestBody {
@@ -71,6 +75,7 @@ func (req *PartnerAttachmentCreateRequest) buildReq() *partnerAttachmentRequestB
7175
Region: req.Region,
7276
NaaSProvider: req.NaaSProvider,
7377
VPCIDs: req.VPCIDs,
78+
RedundancyZone: req.RedundancyZone,
7479
}
7580

7681
if req.BGP != (BGP{}) {
@@ -189,6 +194,8 @@ type PartnerAttachment struct {
189194
VPCIDs []string `json:"vpc_ids,omitempty"`
190195
// BGP is the BGP configuration of the Partner Attachment
191196
BGP BGP `json:"bgp,omitempty"`
197+
// RedundancyZone is the redundancy zone of the Partner Attachment
198+
RedundancyZone string `json:"redundancy_zone,omitempty"`
192199
// CreatedAt is time when this Partner Attachment was first created
193200
CreatedAt time.Time `json:"created_at,omitempty"`
194201
}

partner_network_connect_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ var vPartnerAttachmentTestObj = &PartnerAttachment{
2626
PeerRouterIP: "169.250.0.6",
2727
AuthKey: "my-auth-key",
2828
},
29-
CreatedAt: time.Date(2024, 12, 26, 21, 48, 40, 995304079, time.UTC),
29+
CreatedAt: time.Date(2024, 12, 26, 21, 48, 40, 995304079, time.UTC),
30+
RedundancyZone: "MEGAPORT_RED",
3031
}
3132

3233
var vPartnerAttachmentNoBGPTestObj = &PartnerAttachment{
@@ -38,6 +39,7 @@ var vPartnerAttachmentNoBGPTestObj = &PartnerAttachment{
3839
NaaSProvider: "MEGAPORT",
3940
VPCIDs: []string{"f5a0c5e4-7537-47de-bb8d-46c766f89ffb"},
4041
CreatedAt: time.Date(2024, 12, 26, 21, 48, 40, 995304079, time.UTC),
42+
RedundancyZone: "MEGAPORT_RED",
4143
}
4244

4345
var vPartnerAttachmentTestJSON = `
@@ -56,7 +58,8 @@ var vPartnerAttachmentTestJSON = `
5658
"peer_router_ip":"169.250.0.6",
5759
"auth_key":"my-auth-key"
5860
},
59-
"created_at":"2024-12-26T21:48:40.995304079Z"
61+
"created_at":"2024-12-26T21:48:40.995304079Z",
62+
"redundancy_zone": "MEGAPORT_RED"
6063
}
6164
`
6265

@@ -69,7 +72,8 @@ var vPartnerAttachmentNoBGPTestJSON = `
6972
"region":"NYC",
7073
"naas_provider":"MEGAPORT",
7174
"vpc_ids":["f5a0c5e4-7537-47de-bb8d-46c766f89ffb"],
72-
"created_at":"2024-12-26T21:48:40.995304079Z"
75+
"created_at":"2024-12-26T21:48:40.995304079Z",
76+
"redundancy_zone": "MEGAPORT_RED"
7377
}
7478
`
7579

@@ -139,6 +143,7 @@ func TestPartnerAttachment_Create(t *testing.T) {
139143
PeerASN: 133937,
140144
PeerRouterIP: "169.250.0.6",
141145
},
146+
RedundancyZone: "MEGAPORT_BLUE",
142147
}
143148
jsonBlob := `
144149
{

0 commit comments

Comments
 (0)