Skip to content

Commit

Permalink
Update backup api call method.
Browse files Browse the repository at this point in the history
Signed-off-by: pritamdas99 <[email protected]>
  • Loading branch information
pritamdas99 committed May 22, 2024
1 parent 9c3d419 commit 38326a6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions solr/solr.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ func (sc *SLClient) BackupCollection(ctx context.Context, collection string, bac
backupParams := &BackupParams{
Location: location,
Repository: repository,
Async: fmt.Sprintf("%s-async", backupName),
Async: fmt.Sprintf("%s-backup", collection),
}
req.SetBody(backupParams)

Expand All @@ -151,7 +151,7 @@ func (sc *SLClient) RestoreCollection(ctx context.Context, collection string, ba
Location: location,
Repository: repository,
Collection: collection,
Async: fmt.Sprintf("%s-restore", backupName),
Async: fmt.Sprintf("%s-restore", collection),
}
req.SetBody(restoreParams)

Expand All @@ -169,13 +169,12 @@ func (sc *SLClient) RestoreCollection(ctx context.Context, collection string, ba
return backupResponse, nil
}

func (sc *SLClient) FlushStatus() (*Response, error) {
func (sc *SLClient) FlushStatus(asyncId string) (*Response, error) {
sc.Config.log.V(5).Info("Flush Status")
req := sc.Client.R().SetDoNotParseResponse(true)
req.SetHeader("Content-Type", "application/json")
req.SetQueryParam("flush", "true")

res, err := req.Delete("/api/cluster/command-status")
res, err := req.Delete(fmt.Sprintf("/api/cluster/command-status/%s", asyncId))
if err != nil {
sc.log.Error(err, "Failed to send http request to flush status")
return nil, err
Expand Down

0 comments on commit 38326a6

Please sign in to comment.