From 3baeb629f90be7823a98c61e86870d177c0c3b97 Mon Sep 17 00:00:00 2001 From: MegaportPhilipBrowne Date: Wed, 4 Sep 2024 12:44:29 -0400 Subject: [PATCH 1/2] fix: types for azure peering --- vxc_types.go | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/vxc_types.go b/vxc_types.go index 8b17b31..cf38cce 100644 --- a/vxc_types.go +++ b/vxc_types.go @@ -228,6 +228,7 @@ type VXCOrderConfiguration struct { type VXCOrderEndpointConfiguration struct { ProductUID string `json:"productUid,omitempty"` VLAN int `json:"vlan,omitempty"` + DiversityZone string `json:"diversityZone,omitempty"` PartnerConfig VXCPartnerConfiguration `json:"partnerConfig,omitempty"` *VXCOrderMVEConfig } @@ -442,16 +443,27 @@ type CSPConnectionAWSHC struct { // CSPConnectionAzure represents the configuration of a CSP connection for Azure ExpressRoute. type CSPConnectionAzure struct { CSPConnectionConfig - ConnectType string `json:"connectType"` - ResourceName string `json:"resource_name"` - ResourceType string `json:"resource_type"` - Bandwidth int `json:"bandwidth"` - Managed bool `json:"managed"` - Megaports []CSPConnectionAzureMegaport `json:"megaports"` - Ports []CSPConnectionAzurePort `json:"ports"` - ServiceKey string `json:"service_key"` - VLAN int `json:"vlan"` - Peers []PartnerOrderAzurePeeringConfig `json:"peers"` + ConnectType string `json:"connectType"` + ResourceName string `json:"resource_name"` + ResourceType string `json:"resource_type"` + Bandwidth int `json:"bandwidth"` + Managed bool `json:"managed"` + Megaports []CSPConnectionAzureMegaport `json:"megaports"` + Ports []CSPConnectionAzurePort `json:"ports"` + ServiceKey string `json:"service_key"` + VLAN int `json:"vlan"` + Peers []CSPConnectionAzurePeeringConfig `json:"peers"` +} + +// CSPConnectionAzurePeeringConfig represents the configuration of an Azure peering partner. +type CSPConnectionAzurePeeringConfig struct { + Type string `json:"type"` + PeerASN int `json:"peer_asn"` + PrimarySubnet string `json:"primary_subnet"` + SecondarySubnet string `json:"secondary_subnet"` + Prefixes string `json:"prefixes,omitempty"` + SharedKey string `json:"shared_key,omitempty"` + VLAN int `json:"vlan"` } // CSPConnectionAzureMegaport represents the configuration of a CSP connection for Azure ExpressRoute megaport. From 77284e5306438b1d74038b0253be9f400edc0def Mon Sep 17 00:00:00 2001 From: MegaportPhilipBrowne Date: Thu, 5 Sep 2024 09:54:52 -0400 Subject: [PATCH 2/2] fix: update csp connection oracle struct based on current api response --- vxc_types.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/vxc_types.go b/vxc_types.go index cf38cce..90d087e 100644 --- a/vxc_types.go +++ b/vxc_types.go @@ -529,8 +529,25 @@ type CSPConnectionVirtualRouterInterface struct { type CSPConnectionOracle struct { CSPConnectionConfig - ConnectType string `json:"connectType"` - VirtualCircuitId string `json:"virtualCircuitId"` + ConnectType string `json:"connectType"` + ResourceName string `json:"resource_name"` + ResourceType string `json:"resource_type"` + CSPName string `json:"csp_name"` + Bandwidth int `json:"bandwidth"` + Megaports []CSPConnectionOracleMegaport `json:"megaports"` + Ports []CSPConnectionOraclePort `json:"ports"` + VirtualCircuitId string `json:"virtualCircuitId"` +} + +type CSPConnectionOracleMegaport struct { + Port int `json:"port"` + VXC int `json:"vxc"` +} + +type CSPConnectionOraclePort struct { + ServiceID int `json:"service_id"` + VXCServiceIDs []int `json:"vxc_service_ids"` + FirstVXCServiceID int `json:"firstVxcServiceId,omitempty"` } // CSPConnectionTransit represents the configuration of a CSP connection for a Transit VXC.