From 7f544848b42c6ea8033a2a9e0fdc2016c72e8253 Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Fri, 28 Jul 2023 05:22:01 +0000 Subject: [PATCH] DEVOPS-2886 oracle oci support --- CHANGELOG.md | 6 ++++++ service/mcr/mcr.go | 7 ++++++- service/vxc/partner.go | 4 ++-- types/mcr.go | 1 + types/vxc_order.go | 4 ++-- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1371364..408f6aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 0.1.16 Release + +## New Features + - Support for MCR contract term. + - Oracle partner support and OCI VXC connectivity. Credit @aszynkow + # 0.1.15 Release ## New Features diff --git a/service/mcr/mcr.go b/service/mcr/mcr.go index eacf42d..8e5e735 100644 --- a/service/mcr/mcr.go +++ b/service/mcr/mcr.go @@ -43,9 +43,13 @@ func New(cfg *config.Config) *MCR { } // BuyMCR purchases an MCR. -func (m *MCR) BuyMCR(locationID int, name string, portSpeed int, mcrASN int) (string, error) { +func (m *MCR) BuyMCR(locationID int, name string, term int, portSpeed int, mcrASN int) (string, error) { orderConfig := types.MCROrderConfig{} + if term != 1 && term != 12 && term != 24 && term != 36 { + return "", errors.New(mega_err.ERR_TERM_NOT_VALID) + } + if mcrASN != 0 { orderConfig.ASN = mcrASN } @@ -58,6 +62,7 @@ func (m *MCR) BuyMCR(locationID int, name string, portSpeed int, mcrASN int) (st { LocationID: locationID, Name: name, + Term: term, Type: "MCR2", PortSpeed: portSpeed, Config: orderConfig, diff --git a/service/vxc/partner.go b/service/vxc/partner.go index c34b07c..a06e1ff 100644 --- a/service/vxc/partner.go +++ b/service/vxc/partner.go @@ -145,8 +145,8 @@ func (v *VXC) MarshallPartnerConfig( partnerConfig = newPartnerConfig } else if partner == PARTNER_OCI { partnerConfig = types.PartnerOrderOciPartnerConfig{ - ConnectType: partner, - VirtualCircutId: key, + ConnectType: partner, + VirtualCircutId: key, } } else { return "", errors.New(mega_err.ERR_INVALID_PARTNER) diff --git a/types/mcr.go b/types/mcr.go index 6ee9b8c..cd8d898 100644 --- a/types/mcr.go +++ b/types/mcr.go @@ -17,6 +17,7 @@ package types type MCROrder struct { LocationID int `json:"locationId"` Name string `json:"productName"` + Term int `json:"term"` Type string `json:"productType"` PortSpeed int `json:"portSpeed"` Config MCROrderConfig `json:"config"` diff --git a/types/vxc_order.go b/types/vxc_order.go index 94d5138..ad32fd8 100644 --- a/types/vxc_order.go +++ b/types/vxc_order.go @@ -157,6 +157,6 @@ type PartnerOrderGooglePartnerConfig struct { } type PartnerOrderOciPartnerConfig struct { - ConnectType string `json:"connectType"` - VirtualCircutId string `json:"virtualCircuitId"` + ConnectType string `json:"connectType"` + VirtualCircutId string `json:"virtualCircuitId"` }