1:- module(snapshots, [
    2    create/5,               % +Ps, +Repository, +Snapshots, +Body, -Reply
    3    create/6,               % +Ps, +Repository, +Snapshots, +Params, +Body, -Reply
    4    delete/4,               % +Ps, +Repository, +Snapshots, -Reply
    5    delete/5,               % +Ps, +Repository, +Snapshots, +Params, -Reply
    6    get/4,                  % +Ps, +Repository, +Snapshots, -Reply
    7    get/5,                  % +Ps, +Repository, +Snapshots, +Params, -Reply
    8    delete_repository/3,    % +Ps, +Repository, -Reply
    9    delete_repository/4,    % +Ps, +Repository, +Params, -Reply
   10    get_repository/3,       % +Ps, +Repository, -Reply
   11    get_repository/4,       % +Ps, +Repository, +Params, -Reply
   12    create_repository/4,    % +Ps, +Repository, +Body, -Reply
   13    create_repository/5,    % +Ps, +Repository, +Params, +Body, -Reply
   14    restore/5,              % +Ps, +Repository, +Snapshots, +Body, -Reply
   15    restore/6,              % +Ps, +Repository, +Snapshots, +Params, +Body, -Reply
   16    status/4,               % +Ps, +Repository, +Snapshots, -Reply
   17    status/5,               % +Ps, +Repository, +Snapshots, +Params, -Reply
   18    verify_repository/3,    % +Ps, +Repository, -Reply
   19    verify_repository/4     % +Ps, +Repository, +Params, -Reply
   20]).

Snapshots APIs

The snapshot and restore module allows to create snapshots of individual indices or an entire cluster into a remote repository.

author
- Hongxin Liang
See also
- http://www.elastic.co/guide/en/elasticsearch/reference/master/modules-snapshots.html */
license
- Apache License Version 2.0
 create(+Ps, +Repository, +Snapshot, +Body, -Reply) is semidet
 create(+Ps, +Repository, +Snapshot, +Params, +Body, -Reply) is semidet
Create a snapshot in repository. See here.
   36create(Ps, Repository, Snapshot, Body, Reply) :-
   37    create(Ps, Repository, Snapshot, _{}, Body, Reply).
   38
   39create(Ps, Repository, Snapshot, Params, Body, Reply) :-
   40    forall(member(Value-Name, [Repository-repository, Snapshot-snapshot]), non_empty(Value, Name)),
   41    make_context(['_snapshot', Repository, Snapshot], Context),
   42    perform_request(Ps, put, Context, Params, Body, _, Reply).
 delete(+Ps, +Repository, +Snapshot, -Reply) is semidet
 delete(+Ps, +Repository, +Snapshot, +Params, -Reply) is semidet
Delete a snapshot from repository. See here.
   50delete(Ps, Repository, Snapshot, Reply) :-
   51    delete(Ps, Repository, Snapshot, _{}, Reply).
   52
   53delete(Ps, Repository, Snapshot, Params, Reply) :-
   54    forall(member(Value-Name, [Repository-repository, Snapshot-snapshot]), non_empty(Value, Name)),
   55    make_context(['_snapshot', Repository, Snapshot], Context),
   56    perform_request(Ps, delete, Context, Params, _, Reply).
 get(+Ps, +Repository, +Snapshot, -Reply) is semidet
 get(+Ps, +Repository, +Snapshot, +Params, -Reply) is semidet
Retrieve information about a snapshot. See here.
   64get(Ps, Repository, Snapshot, Reply) :-
   65    get(Ps, Repository, Snapshot, _{}, Reply).
   66
   67get(Ps, Repository, Snapshot, Params, Reply) :-
   68    forall(member(Value-Name, [Repository-repository, Snapshot-snapshot]), non_empty(Value, Name)),
   69    make_context(['_snapshot', Repository, Snapshot], Context),
   70    perform_request(Ps, get, Context, Params, _, Reply).
 delete_repository(+Ps, +Repository, -Reply) is semidet
 delete_repository(+Ps, +Repository, +Params, -Reply) is semidet
Removes a shared file system repository. See here.
   78delete_repository(Ps, Repository, Reply) :-
   79    delete_repository(Ps, Repository, _{}, Reply).
   80
   81delete_repository(Ps, Repository, Params, Reply) :-
   82    non_empty(Repository, repository),
   83    make_context(['_snapshot', Repository], Context),
   84    perform_request(Ps, delete, Context, Params, _, Reply).
 get_repository(+Ps, +Repository, -Reply) is semidet
 get_repository(+Ps, +Repository, +Params, -Reply) is semidet
Return information about registered repositories. See here.
   92get_repository(Ps, Repository, Reply) :-
   93    get_repository(Ps, Repository, _{}, Reply).
   94
   95get_repository(Ps, Repository, Params, Reply) :-
   96    make_context(['_snapshot', Repository], Context),
   97    perform_request(Ps, get, Context, Params, _, Reply).
 create_repository(+Ps, +Repository, +Body, -Reply) is semidet
 create_repository(+Ps, +Repository, +Params, +Body, -Reply) is semidet
Registers a shared file system repository. See here.
  105create_repository(Ps, Repository, Body, Reply) :-
  106    create_repository(Ps, Repository, _{}, Body, Reply).
  107
  108create_repository(Ps, Repository, Params, Body, Reply) :-
  109    forall(member(Value-Name, [Repository-repository, Body-body]), non_empty(Value, Name)),
  110    make_context(['_snapshot', Repository], Context),
  111    perform_request(Ps, put, Context, Params, Body, _, Reply).
 restore(+Ps, +Repository, +Snapshot, +Body, -Reply) is semidet
 restore(+Ps, +Repository, +Snapshot, +Params, +Body, -Reply) is semidet
Restore a snapshot in repository. See here.
  119restore(Ps, Repository, Snapshot, Body, Reply) :-
  120    restore(Ps, Repository, Snapshot, _{}, Body, Reply).
  121
  122restore(Ps, Repository, Snapshot, Params, Body, Reply) :-
  123    forall(member(Value-Name, [Repository-repository, Snapshot-snapshot]), non_empty(Value, Name)),
  124    make_context(['_snapshot', Repository, Snapshot, '_restore'], Context),
  125    perform_request(Ps, post, Context, Params, Body, _, Reply).
 status(+Ps, +Repository, +Snapshot, -Reply) is semidet
 status(+Ps, +Repository, +Snapshot, +Params, -Reply) is semidet
Return information about all currently running snapshots. By specifying a repository name, it's possible to limit the results to a particular repository. See here.
  135status(Ps, Repository, Snapshot, Reply) :-
  136    status(Ps, Repository, Snapshot, _{}, Reply).
  137
  138status(Ps, Repository, Snapshot, Params, Reply) :-
  139    make_context(['_snapshot', Repository, Snapshot, '_status'], Context),
  140    perform_request(Ps, get, Context, Params, _, Reply).
 verify_repository(+Ps, +Repository, -Reply) is semidet
 verify_repository(+Ps, +Repository, +Params, -Reply) is semidet
Returns a list of nodes where repository was successfully verified or an error message if verification process failed. See here.
  149verify_repository(Ps, Repository, Reply) :-
  150    verify_repository(Ps, Repository, _{}, Reply).
  151
  152verify_repository(Ps, Repository, Params, Reply) :-
  153    non_empty(Repository, repository),
  154    make_context(['_snapshot', Repository, '_verify'], Context),
  155    perform_request(Ps, post, Context, Params, '', _, Reply)