Skip to content

Commit

Permalink
feat: mveLabel field for MVE and Max VXC Speed for port, mcr, and mve
Browse files Browse the repository at this point in the history
  • Loading branch information
MegaportPhilipBrowne committed Jan 30, 2025
1 parent d96cdfe commit 1e4ca01
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions mcr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ func (suite *MCRClientTestSuite) TestGetMCR() {
CreatedBy: companyUid,
Market: "US",
PortSpeed: 1000,
MaxVXCSpeed: 1000,
CompanyName: "Test Company",
LocationDetails: &ProductLocationDetails{
Name: "Test Location",
Expand Down Expand Up @@ -379,6 +380,7 @@ func (suite *MCRClientTestSuite) TestModifyMCR() {
Cancelable: true,
VXCPermitted: true,
Virtual: true,
MaxVXCSpeed: 1000,
CompanyUID: companyUid,
UsageAlgorithm: "POST_PAID_HOURLY_SPEED_MCR2",
AttributeTags: map[string]string{},
Expand Down
1 change: 1 addition & 0 deletions mcr_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type MCR struct {
MarketplaceVisibility bool `json:"marketplaceVisibility"`
VXCPermitted bool `json:"vxcpermitted"`
VXCAutoApproval bool `json:"vxcAutoApproval"`
MaxVXCSpeed int `json:"maxVxcSpeed"`
SecondaryName string `json:"secondaryName"`
LAGPrimary bool `json:"lagPrimary"`
LAGID int `json:"lagId"`
Expand Down
6 changes: 4 additions & 2 deletions mve_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ func (suite *MVEClientTestSuite) TestGetMVE() {
MarketplaceVisibility: false,
VXCPermitted: true,
VXCAutoApproval: false,
MaxVXCSpeed: 10000,
CompanyUID: companyUid,
CompanyName: "test-company",
ContractStartDate: startDate,
Expand Down Expand Up @@ -322,8 +323,9 @@ func (suite *MVEClientTestSuite) TestGetMVE() {
},
},
},
Vendor: "PALO_ALTO",
Size: "SMALL",
Vendor: "PALO_ALTO",
Size: "SMALL",
MVELabel: "MVE 2/8",
NetworkInterfaces: []*MVENetworkInterface{
{
VLAN: 0,
Expand Down
2 changes: 2 additions & 0 deletions mve_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ type MVE struct {
LocationID int `json:"locationId"`
UsageAlgorithm string `json:"usageAlgorithm"`
MarketplaceVisibility bool `json:"marketplaceVisibility"`
MaxVXCSpeed int `json:"maxVxcSpeed"`
VXCPermitted bool `json:"vxcpermitted"`
VXCAutoApproval bool `json:"vxcAutoApproval"`
SecondaryName string `json:"secondaryName"`
Expand All @@ -201,6 +202,7 @@ type MVE struct {
Resources *MVEResources `json:"resources"`
Vendor string `json:"vendor"`
Size string `json:"mveSize"`
MVELabel string `json:"mveLabel"`
DiversityZone string `json:"diversityZone"`
NetworkInterfaces []*MVENetworkInterface `json:"vnics"`
LocationDetails *ProductLocationDetails `json:"locationDetail"`
Expand Down
3 changes: 2 additions & 1 deletion port_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ func (suite *PortClientTestSuite) TestGetPort() {
VXCPermitted: true,
VXCAutoApproval: false,
Virtual: false,
MaxVXCSpeed: 10000,
BuyoutPort: false,
CompanyName: "test-company",
CompanyUID: companyUid,
Expand All @@ -284,7 +285,7 @@ func (suite *PortClientTestSuite) TestGetPort() {
"message": "Found Product 36b3f68e-2f54-4331-bf94-f8984449365f",
"terms": "This data is subject to the Acceptable Use Policy https://www.megaport.com/legal/acceptable-use-policy",
"data": {
"productId":999999,"productUid":"36b3f68e-2f54-4331-bf94-f8984449365f","productName":"test-port","productType":"megaport","provisioningStatus":"CONFIGURED","createDate":1706104800000,"createdBy":"","portSpeed":10000,"terminateDate":1737727200000,"liveDate":1737728200000,"market":"US","locationId":226,"usageAlgorithm":"","marketplaceVisibility":false,"vxcpermitted":true,"vxcAutoApproval":false,"secondaryName":"test-secondary-name","lagPrimary":false,"lagId":0,"aggregationId":0,"companyUid":"32df7107-fdca-4c2a-8ccb-c6867813b3f2","companyName":"test-company","contractStartDate":1706104800000,"contractEndDate":1737727200000,"contractTermMonths":12,"attributeTags":null,"virtual":false,"buyoutPort":false,"locked":false,"adminLocked":false,"cancelable":true,"locationDetail":{"name":"Test Location","city":"Atlanta","metro":"Atlanta","country":"USA"},"resources":{"interface":{"demarcation":"","description":"","id":0,"loa_template":"","media":"","name":"","port_speed":0,"resource_name":"","resource_type":"","up":0}}
"productId":999999,"productUid":"36b3f68e-2f54-4331-bf94-f8984449365f","productName":"test-port","productType":"megaport","provisioningStatus":"CONFIGURED","maxVxcSpeed":10000,"createDate":1706104800000,"createdBy":"","portSpeed":10000,"terminateDate":1737727200000,"liveDate":1737728200000,"market":"US","locationId":226,"usageAlgorithm":"","marketplaceVisibility":false,"vxcpermitted":true,"vxcAutoApproval":false,"secondaryName":"test-secondary-name","lagPrimary":false,"lagId":0,"aggregationId":0,"companyUid":"32df7107-fdca-4c2a-8ccb-c6867813b3f2","companyName":"test-company","contractStartDate":1706104800000,"contractEndDate":1737727200000,"contractTermMonths":12,"attributeTags":null,"virtual":false,"buyoutPort":false,"locked":false,"adminLocked":false,"cancelable":true,"locationDetail":{"name":"Test Location","city":"Atlanta","metro":"Atlanta","country":"USA"},"resources":{"interface":{"demarcation":"","description":"","id":0,"loa_template":"","media":"","name":"","port_speed":0,"resource_name":"","resource_type":"","up":0}}
}
}`
suite.mux.HandleFunc(fmt.Sprintf("/v2/product/%s", productUid), func(w http.ResponseWriter, r *http.Request) {
Expand Down
1 change: 1 addition & 0 deletions port_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type Port struct {
LocationID int `json:"locationId"`
UsageAlgorithm string `json:"usageAlgorithm"`
MarketplaceVisibility bool `json:"marketplaceVisibility"`
MaxVXCSpeed int `json:"maxVxcSpeed"`
VXCPermitted bool `json:"vxcpermitted"`
VXCAutoApproval bool `json:"vxcAutoApproval"`
SecondaryName string `json:"secondaryName"`
Expand Down

0 comments on commit 1e4ca01

Please sign in to comment.