Skip to content

Commit

Permalink
Remove mtu and access config defaults from SDK (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
ismirlia authored Oct 19, 2023
1 parent 750fdf5 commit 9a3fe92
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions clients/instance/ibm-pi-network.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,9 @@ func (f *IBMPINetworkClient) GetAll() (*models.Networks, error) {

// Create a Network
func (f *IBMPINetworkClient) Create(body *models.NetworkCreate) (*models.Network, error) {
// Set defaults incase user does not
if body.Mtu == nil {
var defaultMTU int64 = 1450
body.Mtu = &defaultMTU
}
if body.AccessConfig == "" {
var defaultAccessConfig models.AccessConfig = "internal-only"
body.AccessConfig = defaultAccessConfig
}
// Check for satellite differences in this endpoint
if f.session.IsOnPrem() && body.Jumbo {
return nil, fmt.Errorf("jumbo parameter is not supported in satellite location, use mtu instead")
} else if !f.session.IsOnPrem() && ((body.Mtu != nil && *body.Mtu != 1450) || body.AccessConfig != "internal-only") {
return nil, fmt.Errorf("mtu and accessConfig parameters are not supported in multi-zone location, check documentation")
}
params := p_cloud_networks.NewPcloudNetworksPostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
Expand Down

0 comments on commit 9a3fe92

Please sign in to comment.