Skip to content

Commit

Permalink
fix12
Browse files Browse the repository at this point in the history
  • Loading branch information
SivaanandM committed Jul 8, 2024
1 parent 8ec8a9a commit 3572fa9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
16 changes: 4 additions & 12 deletions client/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -294,19 +294,11 @@ func (h *V1Client) DownloadLogs(uid string, logFetcherUid string) (io.Writer, er

func (h *V1Client) UpdatePauseAgentUpgradeSettingCluster(upgradeSetting *models.V1ClusterUpgradeSettingsEntity, clusterUID string, context string) error {

//var params *V1Client.V1SpectroClustersUIDUpgradeSettingsParams
// params := clientV1.NewV1SpectroClustersUIDUpgradeSettingsParamsWithContext(h.Ctx)
//params := clientV1.NewV1ClusterUpgrad
////switch context {
////case "project":
//// params = clientV1.NewV1SpectroClustersUIDUpgradeSettingsParamsWithContext(h.Ctx)
////case "tenant":
//// params = clientV1.NewV1SpectroClustersUIDUpgradeSettingsParams()
////default:
//// return fmt.Errorf("invalid context: %s", context)
////}
//params := clientV1.NewV1SpectroClustersUIDUpgradesPutParamsWithContext(h.ctx)
//params := clientV1.NewV1SpectroClustersUIDUpgradesPutParams
//params = params.WithUID(clusterUID).WithBody(upgradeSetting)
//_, err := h.GetClusterClient().V1SpectroClustersUIDUpgradeSettings(params)
//_, err := h.Client.V1SpectroClustersUIDUpgradesPut()
//
//if err != nil {
// return err
//}
Expand Down
File renamed without changes.
18 changes: 17 additions & 1 deletion client/cluster_profile_import.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package client

import (
"errors"
"github.com/go-openapi/runtime"

"github.com/spectrocloud/palette-api-go/apiutil/transport"
clientV1 "github.com/spectrocloud/palette-api-go/client/v1"
"github.com/spectrocloud/palette-api-go/models"
"github.com/spectrocloud/palette-sdk-go/client/apiutil"
)

Expand All @@ -17,3 +19,17 @@ func (h *V1Client) CreateClusterProfileImport(importFile runtime.NamedReadCloser
}
return *resp.Payload.UID, nil
}

func (h *V1Client) ClusterProfileExport(uid string) (*models.V1ClusterProfile, error) {
// no need to switch request context here as /v1/clusterprofiles/{uid} works for profile in any scope.
params := clientV1.NewV1ClusterProfilesGetParamsWithContext(h.ctx).WithUID(uid)
success, err := h.Client.V1ClusterProfilesGet(params)
var e *transport.TransportError
if errors.As(err, &e) && e.HttpCode == 404 {
return nil, nil
} else if err != nil {
return nil, err
}

return success.Payload, nil
}

0 comments on commit 3572fa9

Please sign in to comment.