Elastix.Snapshot.Snapshot (Elastix v0.10.0) View Source

Functions for working with snapshots.

Elastic documentation

Link to this section Summary

Functions

Deletes a snapshot from a repository.

If repo_name and snapshot_name is specified, will retrieve information about that snapshot. If repo_name is specified, will retrieve information about all snapshots in that repository. Otherwise, will retrieve information about all snapshots.

If repo_name and snapshot_name is specified, will retrieve the status of that snapsot. If repo_name is specified, will retrieve the status of all snapshots in that repository. Otherwise, will retrieve the status of all snapshots.

Link to this section Functions

Link to this function

create(elastic_url, repo_name, snapshot_name, data \\ %{}, query_params \\ [], options \\ [])

View Source

Specs

create(String.t(), String.t(), String.t(), Map.t(), [tuple()], Keyword.t()) ::
  {:ok,
   %HTTPoison.Response{
     body: term(),
     headers: term(),
     request: term(),
     request_url: term(),
     status_code: term()
   }}

Creates a snapshot.

Link to this function

delete(elastic_url, repo_name, snapshot_name, options \\ [])

View Source

Specs

delete(String.t(), String.t(), String.t(), Keyword.t()) ::
  {:ok,
   %HTTPoison.Response{
     body: term(),
     headers: term(),
     request: term(),
     request_url: term(),
     status_code: term()
   }}

Deletes a snapshot from a repository.

This can also be used to stop currently running snapshot and restore operations. Snapshot deletes can be slow, so you can pass in HTTPoison/Hackney options in an httpoison_options keyword argument like :recv_timeout to wait longer.

Examples

iex> Elastix.Snapshot.Snapshot.delete("http://localhost:9200", "backups", "snapshot_123", httpoison_options: [recv_timeout: 30_000])
{:ok, %HTTPoison.Response{...}}
Link to this function

get(elastic_url, repo_name \\ "", snapshot_name \\ "_all", options \\ [])

View Source

Specs

get(String.t(), String.t(), String.t(), Keyword.t()) ::
  {:ok,
   %HTTPoison.Response{
     body: term(),
     headers: term(),
     request: term(),
     request_url: term(),
     status_code: term()
   }}

If repo_name and snapshot_name is specified, will retrieve information about that snapshot. If repo_name is specified, will retrieve information about all snapshots in that repository. Otherwise, will retrieve information about all snapshots.

Link to this function

restore(elastic_url, repo_name, snapshot_name, data \\ %{}, options \\ [])

View Source

Specs

restore(String.t(), String.t(), String.t(), Map.t(), Keyword.t()) ::
  {:ok,
   %HTTPoison.Response{
     body: term(),
     headers: term(),
     request: term(),
     request_url: term(),
     status_code: term()
   }}

Restores a previously created snapshot.

Link to this function

status(elastic_url, repo_name \\ "", snapshot_name \\ "", options \\ [])

View Source

Specs

status(String.t(), String.t(), String.t(), Keyword.t()) ::
  {:ok,
   %HTTPoison.Response{
     body: term(),
     headers: term(),
     request: term(),
     request_url: term(),
     status_code: term()
   }}

If repo_name and snapshot_name is specified, will retrieve the status of that snapsot. If repo_name is specified, will retrieve the status of all snapshots in that repository. Otherwise, will retrieve the status of all snapshots.