Module: DPN::Client::Agent::Replicate

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

Instance Method Summary collapse

Instance Method Details

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

Create a replication request

Parameters:

  • request (Hash)

    Body of the replication request

Yields:

Returns:



55
56
57
# File 'lib/dpn/client/agent/replicate.rb', line 55

def create_replication(request, &block)
  post "/replicate/", request, &block
end

#replicate(replication_id) {|Response| ... } ⇒ Response #replicate(options, &block) ⇒ Array<Hash>

Overloads:

  • #replicate(replication_id) {|Response| ... } ⇒ Response

    Get a specific replication request.

    Parameters:

    • replication_id (String)

    Yields:

    Returns:

  • #replicate(options, &block) ⇒ Array<Hash>

    Alias for #replications

    Returns:

    • (Array<Hash>)

    See Also:



40
41
42
# File 'lib/dpn/client/agent/replicate.rb', line 40

def replicate(replication_id, &block)
  get "/replicate/#{replication_id}/", nil, &block
end

#replication(replication_id, &block) ⇒ Object

Alias of #replicate



46
47
48
# File 'lib/dpn/client/agent/replicate.rb', line 46

def replication(replication_id, &block)
  replicate replication_id, &block
end

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

Get the replication 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.

  • store_requested (Boolean) — default: nil

    Filter by the value of store_requested.

  • stored (Boolean) — default: nil

    Filter by the value of stored.

  • 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 replication.



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

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

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

Update a replication request

Parameters:

  • request (Hash)

    Body of the replication request

Yields:

Returns:



64
65
66
# File 'lib/dpn/client/agent/replicate.rb', line 64

def update_replication(request, &block)
  put "/replicate/#{request[:replication_id]}/", request, &block
end