diff --git a/mve.go b/mve.go index 84347f9..171b98b 100644 --- a/mve.go +++ b/mve.go @@ -48,6 +48,7 @@ type BuyMVERequest struct { Vnics []MVENetworkInterface DiversityZone string PromoCode string + CostCentre string WaitForProvision bool // Wait until the MVE provisions before returning WaitForTime time.Duration // How long to wait for the MVE to provision if WaitForProvision is true (default is 5 minutes) @@ -63,6 +64,7 @@ type ModifyMVERequest struct { MVEID string Name string MarketplaceVisibility *bool + CostCentre string WaitForUpdate bool // Wait until the MCVEupdates before returning WaitForTime time.Duration // How long to wait for the MVE to update if WaitForUpdate is true (default is 5 minutes) @@ -94,6 +96,7 @@ func (svc *MVEServiceOp) BuyMVE(ctx context.Context, req *BuyMVERequest) (*BuyMV Name: req.Name, Term: req.Term, PromoCode: req.PromoCode, + CostCentre: req.CostCentre, ProductType: strings.ToUpper(PRODUCT_MVE), DiversityZone: req.DiversityZone, } @@ -260,10 +263,15 @@ func (svc *MVEServiceOp) ModifyMVE(ctx context.Context, req *ModifyMVERequest) ( modifyProductReq := &ModifyProductRequest{ ProductID: req.MVEID, ProductType: PRODUCT_MVE, - Name: req.Name, - CostCentre: "", MarketplaceVisibility: PtrTo(false), } + if req.Name != "" { + modifyProductReq.Name = req.Name + } + if req.CostCentre != "" { + modifyProductReq.CostCentre = req.CostCentre + } + _, err := svc.Client.ProductService.ModifyProduct(ctx, modifyProductReq) if err != nil { return nil, err diff --git a/mve_types.go b/mve_types.go index b04124a..1481b16 100644 --- a/mve_types.go +++ b/mve_types.go @@ -8,6 +8,7 @@ type MVEOrderConfig struct { ProductType string `json:"productType"` DiversityZone string `json:"diversityZone"` PromoCode string `json:"promoCode,omitempty"` + CostCentre string `json:"costCentre,omitempty"` NetworkInterfaces []MVENetworkInterface `json:"vnics"` VendorConfig VendorConfig `json:"vendorConfig"` } @@ -152,6 +153,7 @@ type MVE struct { ContractEndDate *Time `json:"contractEndDate"` ContractTermMonths int `json:"contractTermMonths"` AttributeTags map[string]string `json:"attributeTags"` + CostCentre string `json:"costCentre"` Virtual bool `json:"virtual"` BuyoutPort bool `json:"buyoutPort"` Locked bool `json:"locked"`