Skip to content

Commit

Permalink
DG-28970 | Add backup_requests method
Browse files Browse the repository at this point in the history
  • Loading branch information
Swapnil Srivastava authored and Swapnil Srivastava committed Jul 19, 2024
1 parent a4f5bfb commit ebf48be
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/sfrest/backup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ def create_backup(site_id, datum = nil)
@conn.post(current_path, datum.to_json)
end

def backup_requests(rest_conn, site_nid, components)
name = "rest#{Time.now.to_i}"
payload = { 'label' => name, 'callback_url' => 'http://www.example.com', 'components' => components }.to_json
output = rest_conn.post "/api/v1/sites/#{site_nid}/backup", payload
task_id = output['task_id'].to_i
expect(task_id).to be_positive
end

# Gets a url to download a backup
# @param [Integer] site_id Node id of site
# @param [Integer] backup_id Id of backup to delete
Expand Down

0 comments on commit ebf48be

Please sign in to comment.