Skip to content

Commit

Permalink
Update Create VPN (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkad authored Dec 14, 2023
1 parent e85cdc0 commit 4a5b667
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions clients/instance/ibm-pi-vpn.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,7 @@ func (f *IBMPIVpnConnectionClient) Get(id string) (*models.VPNConnection, error)

// Create a VPN Connection
func (f *IBMPIVpnConnectionClient) Create(body *models.VPNConnectionCreate) (*models.VPNConnectionCreateResponse, error) {
if f.session.IsOnPrem() {
return nil, fmt.Errorf("operation not supported in satellite location, check documentation")
}
params := p_cloud_v_p_n_connections.NewPcloudVpnconnectionsPostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithBody(body)
postaccepted, err := f.session.Power.PCloudvpnConnections.PcloudVpnconnectionsPost(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf(errors.CreateVPNConnectionOperationFailed, f.cloudInstanceID, err))
}
if postaccepted != nil && postaccepted.Payload != nil {
return postaccepted.Payload, nil
}
return nil, fmt.Errorf("failed to Create VPN Connection")
return nil, fmt.Errorf("Create VPN Connection is no longer supported")
}

// Update a VPN Connection
Expand Down

0 comments on commit 4a5b667

Please sign in to comment.