Skip to content

Commit

Permalink
Revert "Update Create VPN (#248)" (#297)
Browse files Browse the repository at this point in the history
This reverts commit 4a5b667.
  • Loading branch information
michaelkad authored Jan 3, 2024
1 parent b7188d1 commit 425e9a9
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion clients/instance/ibm-pi-vpn.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,20 @@ func (f *IBMPIVpnConnectionClient) Get(id string) (*models.VPNConnection, error)

// Create a VPN Connection
func (f *IBMPIVpnConnectionClient) Create(body *models.VPNConnectionCreate) (*models.VPNConnectionCreateResponse, error) {
return nil, fmt.Errorf("Create VPN Connection is no longer supported")
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")
}

// Update a VPN Connection
Expand Down

0 comments on commit 425e9a9

Please sign in to comment.