Skip to content

Commit

Permalink
Update spp safeguards for stratos (#379)
Browse files Browse the repository at this point in the history
* Update spp safeguards for stratos

SPP commands will be supported for Q2 for stratos, but not the
dedicated host-id option.

* Update host-id error message
  • Loading branch information
ismirlia authored Apr 15, 2024
1 parent 7fb40d4 commit 5db10f2
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions clients/instance/ibm-pi-shared-processor-pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ func NewIBMPISharedProcessorPoolClient(ctx context.Context, sess *ibmpisession.I

// Get a PI Shared Processor Pool
func (f *IBMPISharedProcessorPoolClient) Get(id string) (*models.SharedProcessorPoolDetail, error) {
if f.session.IsOnPrem() {
return nil, fmt.Errorf("operation not supported in satellite location, check documentation")
}
params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsGetParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithSharedProcessorPoolID(id)
Expand All @@ -44,9 +41,6 @@ func (f *IBMPISharedProcessorPoolClient) Get(id string) (*models.SharedProcessor

// Get All Shared Processor Pools
func (f *IBMPISharedProcessorPoolClient) GetAll() (*models.SharedProcessorPools, error) {
if f.session.IsOnPrem() {
return nil, fmt.Errorf("operation not supported in satellite location, check documentation")
}
params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsGetallParams().
WithContext(f.ctx).WithTimeout(helpers.PIGetTimeOut).
WithCloudInstanceID(f.cloudInstanceID)
Expand All @@ -62,8 +56,9 @@ func (f *IBMPISharedProcessorPoolClient) GetAll() (*models.SharedProcessorPools,

// Create a Shared Processor Pool
func (f *IBMPISharedProcessorPoolClient) Create(body *models.SharedProcessorPoolCreate) (*models.SharedProcessorPool, error) {
if f.session.IsOnPrem() {
return nil, fmt.Errorf("operation not supported in satellite location, check documentation")
// Check for satellite differences in this endpoint
if f.session.IsOnPrem() && body.HostID != "" {
return nil, fmt.Errorf("host id parameter is not supported in satellite location, check documentation")
}
params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsPostParams().
WithContext(f.ctx).WithTimeout(helpers.PICreateTimeOut).
Expand All @@ -80,9 +75,6 @@ func (f *IBMPISharedProcessorPoolClient) Create(body *models.SharedProcessorPool

// Delete a Shared Processor Pool
func (f *IBMPISharedProcessorPoolClient) Delete(id string) error {
if f.session.IsOnPrem() {
return fmt.Errorf("operation not supported in satellite location, check documentation")
}
params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsDeleteParams().
WithContext(f.ctx).WithTimeout(helpers.PIDeleteTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithSharedProcessorPoolID(id)
Expand All @@ -95,9 +87,6 @@ func (f *IBMPISharedProcessorPoolClient) Delete(id string) error {

// Update a PI Shared Processor Pool
func (f *IBMPISharedProcessorPoolClient) Update(id string, body *models.SharedProcessorPoolUpdate) (*models.SharedProcessorPool, error) {
if f.session.IsOnPrem() {
return nil, fmt.Errorf("operation not supported in satellite location, check documentation")
}
params := p_cloud_shared_processor_pools.NewPcloudSharedprocessorpoolsPutParams().
WithContext(f.ctx).WithTimeout(helpers.PIUpdateTimeOut).
WithCloudInstanceID(f.cloudInstanceID).WithBody(body).WithSharedProcessorPoolID(id)
Expand Down

0 comments on commit 5db10f2

Please sign in to comment.