diff --git a/vxc_types.go b/vxc_types.go index 90d087e..1f39da9 100644 --- a/vxc_types.go +++ b/vxc_types.go @@ -280,6 +280,17 @@ type VXCPartnerConfigTransit struct { ConnectType string `json:"connectType"` } +// VXCPartnerConfigIBM represents the configuration of a VXC partner for IBM Cloud Direct Link. +type VXCPartnerConfigIBM struct { + VXCPartnerConfiguration `json:"-"` + ConnectType string `json:"connectType"` + AccountID string `json:"account_id"` // Customer's IBM Acount ID. 32 Hexadecimal Characters. REQUIRED + CustomerASN int `json:"customer_asn"` // Customer's ASN. Valid ranges: 1-64495, 64999, 131072-4199999999, 4201000000-4201064511. Required unless the connection at the other end of the VXC is an MCR. + Name string `json:"name"` // Description of this connection for identification purposes. Max 100 characters from 0-9 a-z A-Z / - _ , Defaults to "MEGAPORT". + CustomerIPAddress string `json:"customer_ip_address"` // IPv4 network address including subnet mask. Default is /30 assigned from 169.254.0.0/16. + ProviderIPAddress string `json:"provider_ip_address"` // IPv4 network address including subnet mask. Default is /30 assigned from 169.254.0.0/16. Must be in the same subnet as customer_ip_address. +} + // VXCOrderMVEConfig represents the configuration of a VXC endpoint for MVE. type VXCOrderMVEConfig struct { InnerVLAN int `json:"innerVlan,omitempty"` @@ -562,6 +573,21 @@ type CSPConnectionTransit struct { IPv6GatewayAddress string `json:"ipv6_gateway_address"` } +// CSPConnectionIBM represents the configuration of a CSP connection for IBM Cloud Direct Link. +type CSPConnectionIBM struct { + CSPConnectionConfig + ConnectType string `json:"connectType"` + ResourceName string `json:"resource_name"` + ResourceType string `json:"resource_type"` + CSPName string `json:"csp_name"` + Bandwidth int `json:"bandwidth"` + AccountID string `json:"account_id"` + CustomerASN int `json:"customer_asn"` + ProviderIPAddress string `json:"provider_ip_address"` + CustomerIPAddress string `json:"customer_ip_address"` + Bandwidths []int `json:"bandwidths"` +} + // CSPConnectionOther represents the configuration of a CSP connection for any other CSP that is not presently defined. type CSPConnectionOther struct { CSPConnectionConfig @@ -730,6 +756,16 @@ func (c *CSPConnection) UnmarshalJSON(data []byte) error { return err } c.CSPConnection = append(c.CSPConnection, oracle) + case "IBM": + marshaled, err := json.Marshal(cn) + if err != nil { + return err + } + ibm := CSPConnectionIBM{} + if err := json.Unmarshal(marshaled, &ibm); err != nil { + return err + } + c.CSPConnection = append(c.CSPConnection, ibm) default: // Any other cases will be marshaled into a map[string]interface{} marshaled, err := json.Marshal(cn) if err != nil {