Module: DPN::Client::Agent::Restore

Included in:
DPN::Client::Agent
Defined in:
lib/dpn/client/agent/restore.rb

Instance Method Summary collapse

Instance Method Details

#create_restore(request) {|Response| ... } ⇒ Response

Create a restore request

Parameters:

  • request (Hash)

    Body of the restore request

Yields:

Returns:



44
45
46
# File 'lib/dpn/client/agent/restore.rb', line 44

def create_restore(request, &block)
  post "/restore/", request, &block
end

#restore(restore_id) {|Response| ... } ⇒ Response

Get a specific restore request.

Parameters:

  • restore_id (String)

Yields:

Returns:



35
36
37
# File 'lib/dpn/client/agent/restore.rb', line 35

def restore(restore_id, &block)
  get "/restore/#{restore_id}/", nil, &block
end

#restores(options = {page_size: 25}) {|Response| ... } ⇒ Object

Get the restore request index

Parameters:

  • options (Hash) (defaults to: {page_size: 25})

Options Hash (options):

  • :page_size (Fixnum) — default: 25

    Number of entries per page

  • :before (DateTime String) — default: nil

    Include only entries last modified before this date.

  • :after (DateTime String) — default: nil

    Include only entries last modified after this date.

  • bag (String) — default: nil

    Filter by a specific bag’s UUID.

  • :to_node (String) — default: nil

    Namespace of the to_node of the bag.

  • :from_node (String) — default: nil

    Namespace of the from_node of the bag.

  • accepted (Boolean) — default: nil

    Filter by the value of accepted.

  • finished (Boolean) — default: nil

    Filter by the value of finished.

  • cancelled (Boolean) — default: nil

    Filter by the value of cancelled.

  • cancel_reason (String) — default: nil

    Filter by cancel_reason.

Yields:

  • (Response)

    Block to process each individual result.



26
27
28
# File 'lib/dpn/client/agent/restore.rb', line 26

def restores(options = {page_size: 25}, &block)
  paginate_each "/restore/", options, options[:page_size], &block
end

#update_restore(request) {|Response| ... } ⇒ Response

Update a restore request

Parameters:

  • request (Hash)

    Body of the restore request

Yields:

Returns:



53
54
55
# File 'lib/dpn/client/agent/restore.rb', line 53

def update_restore(request, &block)
  put "/restore/#{request[:restore_id]}/", request, &block
end