Skip to content

Commit

Permalink
Refresh token for every API call
Browse files Browse the repository at this point in the history
Signed-off-by: Yussuf Shaikh <[email protected]>
  • Loading branch information
yussufsh committed Feb 24, 2022
1 parent 33555ac commit b199e83
Show file tree
Hide file tree
Showing 20 changed files with 123 additions and 126 deletions.
16 changes: 8 additions & 8 deletions clients/instance/ibm-pi-clonevolumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (f *IBMPICloneVolumeClient) Create(body *models.VolumesCloneAsyncRequest) (
params := p_cloud_volumes.NewPcloudV2VolumesClonePostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithBody(body)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesClonePost(params, f.authInfo)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesClonePost(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.CreateCloneOperationFailed, err)
}
Expand All @@ -44,7 +44,7 @@ func (f *IBMPICloneVolumeClient) Get(cloneTaskID string) (*models.CloneTaskStatu
params := p_cloud_volumes.NewPcloudV2VolumesClonetasksGetParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithCloneTaskID(cloneTaskID)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesClonetasksGet(params, f.authInfo)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesClonetasksGet(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf("failed to get the clone task %s status for the cloud instance %s with error %w", cloneTaskID, f.cloudInstanceID, err)
}
Expand All @@ -59,7 +59,7 @@ func (f *IBMPICloneVolumeClient) CreateV2Clone(body *models.VolumesCloneCreate)
params := p_cloud_volumes.NewPcloudV2VolumesclonePostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithBody(body)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesclonePost(params, f.authInfo)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumesclonePost(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.PrepareCloneOperationFailed, *body.Name, err)
}
Expand All @@ -74,7 +74,7 @@ func (f *IBMPICloneVolumeClient) GetV2Clones(queryFilter string) (*models.Volume
params := p_cloud_volumes.NewPcloudV2VolumescloneGetallParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithFilter(&queryFilter)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneGetall(params, f.authInfo)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneGetall(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf("failed to get the volumes-clones for the cloud instance %s with error %w", f.cloudInstanceID, err)
}
Expand All @@ -89,7 +89,7 @@ func (f *IBMPICloneVolumeClient) DeleteClone(id string) error {
params := p_cloud_volumes.NewPcloudV2VolumescloneDeleteParams().
WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithVolumesCloneID(id)
_, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneDelete(params, f.authInfo)
_, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneDelete(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return fmt.Errorf(errors.DeleteCloneOperationFailed, err)
}
Expand All @@ -101,7 +101,7 @@ func (f *IBMPICloneVolumeClient) StartClone(volumesCloneID string) (*models.Volu
params := p_cloud_volumes.NewPcloudV2VolumescloneStartPostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithVolumesCloneID(volumesCloneID)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneStartPost(params, f.authInfo)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneStartPost(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.StartCloneOperationFailed, volumesCloneID, err)
}
Expand All @@ -116,7 +116,7 @@ func (f *IBMPICloneVolumeClient) PrepareClone(volumesCloneID string) (*models.Vo
params := p_cloud_volumes.NewPcloudV2VolumescloneExecutePostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithVolumesCloneID(volumesCloneID)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneExecutePost(params, f.authInfo)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneExecutePost(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.PrepareCloneOperationFailed, volumesCloneID, err)
}
Expand All @@ -131,7 +131,7 @@ func (f *IBMPICloneVolumeClient) GetV2CloneStatus(cloneName string) (*models.Vol
params := p_cloud_volumes.NewPcloudV2VolumescloneGetParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithVolumesCloneID(cloneName)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneGet(params, f.authInfo)
resp, err := f.session.Power.PCloudVolumes.PcloudV2VolumescloneGet(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.GetCloneOperationFailed, cloneName, f.cloudInstanceID, err)
}
Expand Down
16 changes: 8 additions & 8 deletions clients/instance/ibm-pi-cloud-connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (f *IBMPICloudConnectionClient) Create(body *models.CloudConnectionCreate)
params := p_cloud_cloud_connections.NewPcloudCloudconnectionsPostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithBody(body)
postok, postcreated, postaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPost(params, f.authInfo)
postok, postcreated, postaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPost(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, nil, fmt.Errorf(errors.CreateCloudConnectionOperationFailed, f.cloudInstanceID, err)
}
Expand All @@ -50,7 +50,7 @@ func (f *IBMPICloudConnectionClient) Get(id string) (*models.CloudConnection, er
params := p_cloud_cloud_connections.NewPcloudCloudconnectionsGetParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithCloudConnectionID(id)
resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGet(params, f.authInfo)
resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGet(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.GetCloudConnectionOperationFailed, id, err)
}
Expand All @@ -65,7 +65,7 @@ func (f *IBMPICloudConnectionClient) GetAll() (*models.CloudConnections, error)
params := p_cloud_cloud_connections.NewPcloudCloudconnectionsGetallParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID)
resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGetall(params, f.authInfo)
resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsGetall(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf("failed to Get all Cloud Connections: %w", err)
}
Expand All @@ -81,7 +81,7 @@ func (f *IBMPICloudConnectionClient) Update(id string, body *models.CloudConnect
WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithCloudConnectionID(id).
WithBody(body)
putok, putaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPut(params, f.authInfo)
putok, putaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsPut(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, nil, fmt.Errorf(errors.UpdateCloudConnectionOperationFailed, id, err)
}
Expand All @@ -99,7 +99,7 @@ func (f *IBMPICloudConnectionClient) Delete(id string) (*models.JobReference, er
params := p_cloud_cloud_connections.NewPcloudCloudconnectionsDeleteParams().
WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithCloudConnectionID(id)
_, delaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsDelete(params, f.authInfo)
_, delaccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsDelete(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.DeleteCloudConnectionOperationFailed, id, err)
}
Expand All @@ -115,7 +115,7 @@ func (f *IBMPICloudConnectionClient) AddNetwork(id, networkID string) (*models.C
WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithCloudConnectionID(id).
WithNetworkID(networkID)
respok, respAccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksPut(params, f.authInfo)
respok, respAccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksPut(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, nil, fmt.Errorf("failed to Add Network %s to Cloud Connection %s: %w", networkID, id, err)
}
Expand All @@ -134,7 +134,7 @@ func (f *IBMPICloudConnectionClient) DeleteNetwork(id, networkID string) (*model
WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithCloudConnectionID(id).
WithNetworkID(networkID)
respok, respAccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksDelete(params, f.authInfo)
respok, respAccepted, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsNetworksDelete(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, nil, fmt.Errorf("failed to Delete Network %s from Cloud Connection %s: %w", networkID, id, err)
}
Expand All @@ -153,7 +153,7 @@ func (f *IBMPICloudConnectionClient) GetVPC() (*models.CloudConnectionVirtualPri
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID)

resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsVirtualprivatecloudsGetall(params, f.authInfo)
resp, err := f.session.Power.PCloudCloudConnections.PcloudCloudconnectionsVirtualprivatecloudsGetall(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf("failed to perform the get vpc operation: %w", err)
}
Expand Down
6 changes: 3 additions & 3 deletions clients/instance/ibm-pi-cloud-instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (f *IBMPICloudInstanceClient) Get(id string) (*models.CloudInstance, error)
params := p_cloud_instances.NewPcloudCloudinstancesGetParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(id)
resp, err := f.session.Power.PCloudInstances.PcloudCloudinstancesGet(params, f.authInfo)
resp, err := f.session.Power.PCloudInstances.PcloudCloudinstancesGet(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.GetCloudInstanceOperationFailed, id, err)
}
Expand All @@ -44,7 +44,7 @@ func (f *IBMPICloudInstanceClient) Update(id string, body *models.CloudInstanceU
params := p_cloud_instances.NewPcloudCloudinstancesPutParams().
WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).
WithCloudInstanceID(id).WithBody(body)
resp, err := f.session.Power.PCloudInstances.PcloudCloudinstancesPut(params, f.authInfo)
resp, err := f.session.Power.PCloudInstances.PcloudCloudinstancesPut(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.UpdateCloudInstanceOperationFailed, id, err)
}
Expand All @@ -59,7 +59,7 @@ func (f *IBMPICloudInstanceClient) Delete(id string) error {
params := p_cloud_instances.NewPcloudCloudinstancesDeleteParams().
WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).
WithCloudInstanceID(id)
_, err := f.session.Power.PCloudInstances.PcloudCloudinstancesDelete(params, f.authInfo)
_, err := f.session.Power.PCloudInstances.PcloudCloudinstancesDelete(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return fmt.Errorf(errors.DeleteCloudInstanceOperationFailed, id, err)
}
Expand Down
8 changes: 4 additions & 4 deletions clients/instance/ibm-pi-dhcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (f *IBMPIDhcpClient) Create(body *models.DHCPServerCreate) (*models.DHCPSer
params := p_cloud_service_d_h_c_p.NewPcloudDhcpPostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithBody(body)
postaccepted, err := f.session.Power.PCloudServicedhcp.PcloudDhcpPost(params, f.authInfo)
postaccepted, err := f.session.Power.PCloudServicedhcp.PcloudDhcpPost(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.CreateDchpOperationFailed, f.cloudInstanceID, err)
}
Expand All @@ -44,7 +44,7 @@ func (f *IBMPIDhcpClient) Get(id string) (*models.DHCPServerDetail, error) {
params := p_cloud_service_d_h_c_p.NewPcloudDhcpGetParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithDhcpID(id)
resp, err := f.session.Power.PCloudServicedhcp.PcloudDhcpGet(params, f.authInfo)
resp, err := f.session.Power.PCloudServicedhcp.PcloudDhcpGet(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.GetDhcpOperationFailed, id, err)
}
Expand All @@ -59,7 +59,7 @@ func (f *IBMPIDhcpClient) GetAll() (models.DHCPServers, error) {
params := p_cloud_service_d_h_c_p.NewPcloudDhcpGetallParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID)
resp, err := f.session.Power.PCloudServicedhcp.PcloudDhcpGetall(params, f.authInfo)
resp, err := f.session.Power.PCloudServicedhcp.PcloudDhcpGetall(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf("failed to Get all DHCP servers: %w", err)
}
Expand All @@ -74,7 +74,7 @@ func (f *IBMPIDhcpClient) Delete(id string) error {
params := p_cloud_service_d_h_c_p.NewPcloudDhcpDeleteParams().
WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithDhcpID(id)
_, err := f.session.Power.PCloudServicedhcp.PcloudDhcpDelete(params, f.authInfo)
_, err := f.session.Power.PCloudServicedhcp.PcloudDhcpDelete(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return fmt.Errorf(errors.DeleteDhcpOperationFailed, id, err)
}
Expand Down
3 changes: 0 additions & 3 deletions clients/instance/ibm-pi-helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"

"github.com/IBM-Cloud/power-go-client/ibmpisession"
"github.com/go-openapi/runtime"
)

/*
Expand All @@ -15,7 +14,6 @@ Helper methods that will be used by the client classes
type IBMPIClient struct {
session *ibmpisession.IBMPISession
cloudInstanceID string
authInfo runtime.ClientAuthInfoWriter
ctx context.Context
}

Expand All @@ -24,7 +22,6 @@ func NewIBMPIClient(ctx context.Context, sess *ibmpisession.IBMPISession, cloudI
return &IBMPIClient{
session: sess,
cloudInstanceID: cloudInstanceID,
authInfo: sess.AuthInfo(cloudInstanceID),
ctx: ctx,
}
}
16 changes: 8 additions & 8 deletions clients/instance/ibm-pi-image.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (f *IBMPIImageClient) Get(id string) (*models.Image, error) {
params := p_cloud_images.NewPcloudCloudinstancesImagesGetParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithImageID(id)
resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesGet(params, f.authInfo)
resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesGet(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.GetImageOperationFailed, id, err)
}
Expand All @@ -44,7 +44,7 @@ func (f *IBMPIImageClient) GetAll() (*models.Images, error) {
params := p_cloud_images.NewPcloudCloudinstancesImagesGetallParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID)
resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesGetall(params, f.authInfo)
resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesGetall(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf("failed to Get all PI Images of the PVM instance %s : %w", f.cloudInstanceID, err)
}
Expand All @@ -63,7 +63,7 @@ func (f *IBMPIImageClient) Create(body *models.CreateImage) (*models.Image, erro
params := p_cloud_images.NewPcloudCloudinstancesImagesPostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithBody(body)
respok, respcreated, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesPost(params, f.authInfo)
respok, respcreated, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesPost(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf(errors.CreateImageOperationFailed, f.cloudInstanceID, err)
}
Expand All @@ -81,7 +81,7 @@ func (f *IBMPIImageClient) CreateCosImage(body *models.CreateCosImageImportJob)
params := p_cloud_images.NewPcloudV1CloudinstancesCosimagesPostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithBody(body)
resp, err := f.session.Power.PCloudImages.PcloudV1CloudinstancesCosimagesPost(params, f.authInfo)
resp, err := f.session.Power.PCloudImages.PcloudV1CloudinstancesCosimagesPost(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf("failed to perform Create COS Image Operation for cloud instance %s with error %w", f.cloudInstanceID, err)
}
Expand All @@ -96,7 +96,7 @@ func (f *IBMPIImageClient) ExportImage(id string, body *models.ExportImage) (*mo
params := p_cloud_images.NewPcloudV2ImagesExportPostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithImageID(id).WithBody(body)
resp, err := f.session.Power.PCloudImages.PcloudV2ImagesExportPost(params, f.authInfo)
resp, err := f.session.Power.PCloudImages.PcloudV2ImagesExportPost(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf("failed to Export COS Image for image id %s with error %w", id, err)
}
Expand All @@ -111,7 +111,7 @@ func (f *IBMPIImageClient) Delete(id string) error {
params := p_cloud_images.NewPcloudCloudinstancesImagesDeleteParams().
WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithImageID(id)
_, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesDelete(params, f.authInfo)
_, err := f.session.Power.PCloudImages.PcloudCloudinstancesImagesDelete(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return fmt.Errorf("failed to Delete PI Image %s: %w", id, err)
}
Expand All @@ -123,7 +123,7 @@ func (f *IBMPIImageClient) GetStockImage(id string) (*models.Image, error) {
params := p_cloud_images.NewPcloudCloudinstancesStockimagesGetParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithImageID(id)
resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesStockimagesGet(params, f.authInfo)
resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesStockimagesGet(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf("failed to Get PI Stock Image %s for cloud instance %s: %w", id, f.cloudInstanceID, err)
}
Expand All @@ -140,7 +140,7 @@ func (f *IBMPIImageClient) GetAllStockImages(includeSAP bool, includeVTl bool) (
WithCloudInstanceID(f.cloudInstanceID).
WithSap(&includeSAP).
WithVtl(&includeVTl)
resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesStockimagesGetall(params, f.authInfo)
resp, err := f.session.Power.PCloudImages.PcloudCloudinstancesStockimagesGetall(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, fmt.Errorf("failed to get Stock Images with (SAP=%t, VTL=%t) for cloud instance %s: %w", includeSAP, includeVTl, f.cloudInstanceID, err)
}
Expand Down
Loading

0 comments on commit b199e83

Please sign in to comment.