Skip to content

Commit

Permalink
Add host reference host get and host list (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
ismirlia authored Nov 21, 2024
1 parent 33a9073 commit df6ead3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clients/instance/ibm-pi-host-groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ func (f *IBMPIHostGroupsClient) GetHosts() (models.HostList, error) {
if f.session.IsOnPrem() {
return nil, fmt.Errorf("operation not supported in satellite location, check documentation")
}
hostReference := true
params := host_groups.NewV1HostsGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut)
params.HostReference = &hostReference
resp, err := f.session.Power.HostGroups.V1HostsGet(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get hosts for %s: %w", f.cloudInstanceID, err))
Expand Down Expand Up @@ -146,7 +148,9 @@ func (f *IBMPIHostGroupsClient) GetHost(id string) (*models.Host, error) {
if f.session.IsOnPrem() {
return nil, fmt.Errorf("operation not supported in satellite location, check documentation")
}
hostReference := true
params := host_groups.NewV1HostsIDGetParams().WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).WithHostID(id)
params.HostReference = &hostReference
resp, err := f.session.Power.HostGroups.V1HostsIDGet(params, f.session.AuthInfo(f.cloudInstanceID))
if err != nil {
return nil, ibmpisession.SDKFailWithAPIError(err, fmt.Errorf("failed to get host %s for %s: %w", id, f.cloudInstanceID, err))
Expand Down

0 comments on commit df6ead3

Please sign in to comment.