Skip to content

Commit

Permalink
DEVOPS-2886 oracle oci support
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Barnes committed Jul 28, 2023
1 parent 718ba11 commit 7f54484
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
7 changes: 6 additions & 1 deletion service/mcr/mcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions service/vxc/partner.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions types/mcr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
4 changes: 2 additions & 2 deletions types/vxc_order.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

0 comments on commit 7f54484

Please sign in to comment.