Skip to content

Commit

Permalink
PLT-765:Added sdk support for repave approval (#71)
Browse files Browse the repository at this point in the history
* PLT-765:Added sdk support for repave approval

* added cluster context validation
  • Loading branch information
SivaanandM authored Nov 23, 2023
1 parent f6bf2e0 commit c7363bd
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions client/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,3 +339,22 @@ func (h *V1Client) ImportClusterGeneric(meta *models.V1ObjectMetaInputEntity) (s

return *success.Payload.UID, nil
}

func (h *V1Client) ApproveClusterRepave(clusterUID string, context string) error {
client, err := h.GetClusterClient()
if err != nil {
return err
}
var params *clusterC.V1SpectroClustersUIDRepaveApproveUpdateParams
switch context {
case "project":
params = clusterC.NewV1SpectroClustersUIDRepaveApproveUpdateParamsWithContext(h.Ctx).WithUID(clusterUID)
case "tenant":
params = clusterC.NewV1SpectroClustersUIDRepaveApproveUpdateParams().WithUID(clusterUID)
default:
err = fmt.Errorf("invalid Context set - %s", context)
return err
}
_, err = client.V1SpectroClustersUIDRepaveApproveUpdate(params)
return err
}

0 comments on commit c7363bd

Please sign in to comment.