From 17b7fe954797f2054b4c0ac9ee3d2a22293f9c73 Mon Sep 17 00:00:00 2001 From: MegaportPhilipBrowne Date: Mon, 23 Sep 2024 10:04:03 -0400 Subject: [PATCH 1/3] feat: vxc partner config IBM --- vxc_types.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/vxc_types.go b/vxc_types.go index 90d087e..9ad00e4 100644 --- a/vxc_types.go +++ b/vxc_types.go @@ -280,6 +280,17 @@ type VXCPartnerConfigTransit struct { ConnectType string `json:"connectType"` } +// VXCPartnerConfigIBM represents the configuration of a VXC partner for IBM Cloud Direct Link. +type VXCPartnerConfigIBM struct { + VXCPartnerConfiguration `json:"-"` + ConnectType string `json:"connectType"` + AccountID string `json:"account_id"` // Customer's IBM Acount ID. 32 Hexadecimal Characters. REQUIRED + CustomerASN int `json:"customer_asn"` // Customer's ASN. Valid ranges: 1-64495, 64999, 131072-4199999999, 4201000000-4201064511. Required unless the connection at the other end of the VXC is an MCR. + Name string `json:"name"` // Description of this connection for identification purposes. Max 100 characters from 0-9 a-z A-Z / - _ , Defaults to "MEGAPORT". + CustomerIPAddress string `json:"customer_ip_address"` // IPv4 network address including subnet mask. Default is /30 assigned from 169.254.0.0/16. + ProviderIPAddress string `json:"provider_ip_address"` // IPv4 network address including subnet mask. Default is /30 assigned from 169.254.0.0/16. Must be in the same subnet as customer_ip_address. +} + // VXCOrderMVEConfig represents the configuration of a VXC endpoint for MVE. type VXCOrderMVEConfig struct { InnerVLAN int `json:"innerVlan,omitempty"` From 1a11c0a010a1da68995e983d83701774e315138b Mon Sep 17 00:00:00 2001 From: MegaportPhilipBrowne Date: Mon, 23 Sep 2024 10:31:54 -0400 Subject: [PATCH 2/3] chore: placeholder for csp connection IBM --- vxc_types.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/vxc_types.go b/vxc_types.go index 9ad00e4..09d8edf 100644 --- a/vxc_types.go +++ b/vxc_types.go @@ -573,6 +573,14 @@ type CSPConnectionTransit struct { IPv6GatewayAddress string `json:"ipv6_gateway_address"` } +// CSPConnectionIBM represents the configuration of a CSP connection for IBM Cloud Direct Link. +type CSPConnectionIBM struct { + CSPConnectionConfig + ConnectType string `json:"connectType"` + ResourceName string `json:"resource_name"` + ResourceType string `json:"resource_type"` +} + // CSPConnectionOther represents the configuration of a CSP connection for any other CSP that is not presently defined. type CSPConnectionOther struct { CSPConnectionConfig @@ -741,6 +749,16 @@ func (c *CSPConnection) UnmarshalJSON(data []byte) error { return err } c.CSPConnection = append(c.CSPConnection, oracle) + case "IBM": + marshaled, err := json.Marshal(cn) + if err != nil { + return err + } + ibm := CSPConnectionIBM{} + if err := json.Unmarshal(marshaled, &ibm); err != nil { + return err + } + c.CSPConnection = append(c.CSPConnection, ibm) default: // Any other cases will be marshaled into a map[string]interface{} marshaled, err := json.Marshal(cn) if err != nil { From 8ff0c90d87d27b8e43d184e8f1150e0f1a4360c7 Mon Sep 17 00:00:00 2001 From: MegaportPhilipBrowne Date: Mon, 23 Sep 2024 11:56:36 -0400 Subject: [PATCH 3/3] fix: csp config for ibm --- vxc_types.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/vxc_types.go b/vxc_types.go index 09d8edf..1f39da9 100644 --- a/vxc_types.go +++ b/vxc_types.go @@ -576,9 +576,16 @@ type CSPConnectionTransit struct { // CSPConnectionIBM represents the configuration of a CSP connection for IBM Cloud Direct Link. type CSPConnectionIBM struct { CSPConnectionConfig - ConnectType string `json:"connectType"` - ResourceName string `json:"resource_name"` - ResourceType string `json:"resource_type"` + ConnectType string `json:"connectType"` + ResourceName string `json:"resource_name"` + ResourceType string `json:"resource_type"` + CSPName string `json:"csp_name"` + Bandwidth int `json:"bandwidth"` + AccountID string `json:"account_id"` + CustomerASN int `json:"customer_asn"` + ProviderIPAddress string `json:"provider_ip_address"` + CustomerIPAddress string `json:"customer_ip_address"` + Bandwidths []int `json:"bandwidths"` } // CSPConnectionOther represents the configuration of a CSP connection for any other CSP that is not presently defined.