@@ -25,7 +25,7 @@ func NewIBMPIHostGroupsClient(ctx context.Context, sess *ibmpisession.IBMPISessi
25
25
// Get All available hosts
26
26
func (f * IBMPIHostGroupsClient ) GetAvailableHosts () (models.AvailableHostList , error ) {
27
27
if f .session .IsOnPrem () {
28
- return nil , fmt .Errorf ("operation not supported in satellite location, check documentation" )
28
+ return nil , fmt .Errorf (helpers . NotOnPremSupported )
29
29
}
30
30
params := host_groups .NewV1AvailableHostsParams ().WithContext (f .ctx ).WithTimeout (helpers .PIGetTimeOut )
31
31
resp , err := f .session .Power .HostGroups .V1AvailableHosts (params , f .session .AuthInfo (f .cloudInstanceID ))
@@ -42,7 +42,7 @@ func (f *IBMPIHostGroupsClient) GetAvailableHosts() (models.AvailableHostList, e
42
42
// Get all host groups
43
43
func (f * IBMPIHostGroupsClient ) GetHostGroups () (models.HostGroupList , error ) {
44
44
if f .session .IsOnPrem () {
45
- return nil , fmt .Errorf ("operation not supported in satellite location, check documentation" )
45
+ return nil , fmt .Errorf (helpers . NotOnPremSupported )
46
46
}
47
47
params := host_groups .NewV1HostGroupsGetParams ().WithContext (f .ctx ).WithTimeout (helpers .PIGetTimeOut )
48
48
resp , err := f .session .Power .HostGroups .V1HostGroupsGet (params , f .session .AuthInfo (f .cloudInstanceID ))
@@ -59,7 +59,7 @@ func (f *IBMPIHostGroupsClient) GetHostGroups() (models.HostGroupList, error) {
59
59
// Create a host group
60
60
func (f * IBMPIHostGroupsClient ) CreateHostGroup (body * models.HostGroupCreate ) (* models.HostGroup , error ) {
61
61
if f .session .IsOnPrem () {
62
- return nil , fmt .Errorf ("operation not supported in satellite location, check documentation" )
62
+ return nil , fmt .Errorf (helpers . NotOnPremSupported )
63
63
}
64
64
params := host_groups .NewV1HostGroupsPostParams ().WithContext (f .ctx ).WithTimeout (helpers .PICreateTimeOut ).WithBody (body )
65
65
resp , err := f .session .Power .HostGroups .V1HostGroupsPost (params , f .session .AuthInfo (f .cloudInstanceID ))
@@ -76,7 +76,7 @@ func (f *IBMPIHostGroupsClient) CreateHostGroup(body *models.HostGroupCreate) (*
76
76
// Update a host group
77
77
func (f * IBMPIHostGroupsClient ) UpdateHostGroup (body * models.HostGroupShareOp , id string ) (* models.HostGroup , error ) {
78
78
if f .session .IsOnPrem () {
79
- return nil , fmt .Errorf ("operation not supported in satellite location, check documentation" )
79
+ return nil , fmt .Errorf (helpers . NotOnPremSupported )
80
80
}
81
81
params := host_groups .NewV1HostGroupsIDPutParams ().WithContext (f .ctx ).WithTimeout (helpers .PICreateTimeOut ).WithBody (body ).WithHostGroupID (id )
82
82
resp , err := f .session .Power .HostGroups .V1HostGroupsIDPut (params , f .session .AuthInfo (f .cloudInstanceID ))
@@ -93,7 +93,7 @@ func (f *IBMPIHostGroupsClient) UpdateHostGroup(body *models.HostGroupShareOp, i
93
93
// Get a host group
94
94
func (f * IBMPIHostGroupsClient ) GetHostGroup (id string ) (* models.HostGroup , error ) {
95
95
if f .session .IsOnPrem () {
96
- return nil , fmt .Errorf ("operation not supported in satellite location, check documentation" )
96
+ return nil , fmt .Errorf (helpers . NotOnPremSupported )
97
97
}
98
98
params := host_groups .NewV1HostGroupsIDGetParams ().WithContext (f .ctx ).WithTimeout (helpers .PIGetTimeOut ).WithHostGroupID (id )
99
99
resp , err := f .session .Power .HostGroups .V1HostGroupsIDGet (params , f .session .AuthInfo (f .cloudInstanceID ))
@@ -110,7 +110,7 @@ func (f *IBMPIHostGroupsClient) GetHostGroup(id string) (*models.HostGroup, erro
110
110
// Get all hosts
111
111
func (f * IBMPIHostGroupsClient ) GetHosts () (models.HostList , error ) {
112
112
if f .session .IsOnPrem () {
113
- return nil , fmt .Errorf ("operation not supported in satellite location, check documentation" )
113
+ return nil , fmt .Errorf (helpers . NotOnPremSupported )
114
114
}
115
115
hostReference := true
116
116
params := host_groups .NewV1HostsGetParams ().WithContext (f .ctx ).WithTimeout (helpers .PIGetTimeOut )
@@ -129,7 +129,7 @@ func (f *IBMPIHostGroupsClient) GetHosts() (models.HostList, error) {
129
129
// Create a host
130
130
func (f * IBMPIHostGroupsClient ) CreateHost (body * models.HostCreate ) (models.HostList , error ) {
131
131
if f .session .IsOnPrem () {
132
- return nil , fmt .Errorf ("operation not supported in satellite location, check documentation" )
132
+ return nil , fmt .Errorf (helpers . NotOnPremSupported )
133
133
}
134
134
params := host_groups .NewV1HostsPostParams ().WithContext (f .ctx ).WithTimeout (helpers .PIGetTimeOut ).WithBody (body )
135
135
resp , err := f .session .Power .HostGroups .V1HostsPost (params , f .session .AuthInfo (f .cloudInstanceID ))
@@ -146,7 +146,7 @@ func (f *IBMPIHostGroupsClient) CreateHost(body *models.HostCreate) (models.Host
146
146
// Get a host
147
147
func (f * IBMPIHostGroupsClient ) GetHost (id string ) (* models.Host , error ) {
148
148
if f .session .IsOnPrem () {
149
- return nil , fmt .Errorf ("operation not supported in satellite location, check documentation" )
149
+ return nil , fmt .Errorf (helpers . NotOnPremSupported )
150
150
}
151
151
hostReference := true
152
152
params := host_groups .NewV1HostsIDGetParams ().WithContext (f .ctx ).WithTimeout (helpers .PIGetTimeOut ).WithHostID (id )
@@ -165,7 +165,7 @@ func (f *IBMPIHostGroupsClient) GetHost(id string) (*models.Host, error) {
165
165
// Update a host
166
166
func (f * IBMPIHostGroupsClient ) UpdateHost (body * models.HostPut , id string ) (* models.Host , error ) {
167
167
if f .session .IsOnPrem () {
168
- return nil , fmt .Errorf ("operation not supported in satellite location, check documentation" )
168
+ return nil , fmt .Errorf (helpers . NotOnPremSupported )
169
169
}
170
170
params := host_groups .NewV1HostsIDPutParams ().WithContext (f .ctx ).WithTimeout (helpers .PIGetTimeOut ).WithHostID (id ).WithBody (body )
171
171
resp , err := f .session .Power .HostGroups .V1HostsIDPut (params , f .session .AuthInfo (f .cloudInstanceID ))
@@ -182,7 +182,7 @@ func (f *IBMPIHostGroupsClient) UpdateHost(body *models.HostPut, id string) (*mo
182
182
// Delete a host
183
183
func (f * IBMPIHostGroupsClient ) DeleteHost (id string ) error {
184
184
if f .session .IsOnPrem () {
185
- return fmt .Errorf ("operation not supported in satellite location, check documentation" )
185
+ return fmt .Errorf (helpers . NotOnPremSupported )
186
186
}
187
187
params := host_groups .NewV1HostsIDDeleteParams ().WithContext (f .ctx ).WithTimeout (helpers .PIGetTimeOut ).WithHostID (id )
188
188
resp , err := f .session .Power .HostGroups .V1HostsIDDelete (params , f .session .AuthInfo (f .cloudInstanceID ))
0 commit comments