Snapshot Client

class opensearchpy.client.snapshot.SnapshotClient(client)[source]

Bases: NamespacedClient

Parameters:

client (Any) –

cleanup_repository(repository, params=None, headers=None)[source]

Removes stale data from repository.

Parameters:
  • repository (Any) – Snapshot repository to clean up.

  • cluster_manager_timeout – Operation timeout for connection to cluster-manager node.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • (Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): Period to wait for a connection to the cluster-manager node.

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • timeout – Period to wait for a response.

  • repository

  • params (Any) –

  • headers (Any) –

Return type:

Any

clone(repository, snapshot, target_snapshot, body, params=None, headers=None)[source]

Clones indexes from one snapshot into another snapshot in the same repository.

Parameters:
  • repository (Any) – A repository name

  • snapshot (Any) – The name of the snapshot to clone from

  • target_snapshot (Any) – The name of the cloned snapshot to create

  • body (Any) – The snapshot clone definition

  • cluster_manager_timeout – Operation timeout for connection to cluster-manager node.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • (Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): Explicit operation timeout for connection to cluster-manager node

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • repository

  • snapshot

  • target_snapshot

  • body

  • params (Any) –

  • headers (Any) –

Return type:

Any

create(repository, snapshot, body=None, params=None, headers=None)[source]

Creates a snapshot in a repository.

Parameters:
  • repository (Any) – Repository for the snapshot.

  • snapshot (Any) – Name of the snapshot. Must be unique in the repository.

  • body (Any) – The snapshot definition

  • cluster_manager_timeout – Operation timeout for connection to cluster-manager node.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • (Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error.

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • wait_for_completion – If true, the request returns a response when the snapshot is complete. If false, the request returns a response when the snapshot initializes. Default is false.

  • repository

  • snapshot

  • body

  • params (Any) –

  • headers (Any) –

Return type:

Any

create_repository(repository, body, params=None, headers=None)[source]

Creates a repository.

Parameters:
  • repository (Any) – A repository name

  • body (Any) – The repository definition

  • cluster_manager_timeout – Operation timeout for connection to cluster-manager node.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • (Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): Explicit operation timeout for connection to cluster-manager node

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • timeout – Explicit operation timeout

  • verify – Whether to verify the repository after creation

  • repository

  • body

  • params (Any) –

  • headers (Any) –

Return type:

Any

delete(repository, snapshot, params=None, headers=None)[source]

Deletes a snapshot.

Parameters:
  • repository (Any) – A repository name

  • snapshot (Any) – A comma-separated list of snapshot names

  • cluster_manager_timeout – Operation timeout for connection to cluster-manager node.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • (Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): Explicit operation timeout for connection to cluster-manager node

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • repository

  • snapshot

  • params (Any) –

  • headers (Any) –

Return type:

Any

delete_repository(repository, params=None, headers=None)[source]

Deletes a repository.

Parameters:
  • repository (Any) – Name of the snapshot repository to unregister. Wildcard (*) patterns are supported.

  • cluster_manager_timeout – Operation timeout for connection to cluster-manager node.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • (Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): Explicit operation timeout for connection to cluster-manager node

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • timeout – Explicit operation timeout

  • repository

  • params (Any) –

  • headers (Any) –

Return type:

Any

get(repository, snapshot, params=None, headers=None)[source]

Returns information about a snapshot.

Parameters:
  • repository (Any) – Comma-separated list of snapshot repository names used to limit the request. Wildcard (*) expressions are supported.

  • snapshot (Any) – Comma-separated list of snapshot names to retrieve. Also accepts wildcards (*). - To get information about all snapshots in a registered repository, use a wildcard (*) or _all. - To get information about any snapshots that are currently running, use _current.

  • cluster_manager_timeout – Operation timeout for connection to cluster-manager node.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • ignore_unavailable – If false, the request returns an error for any snapshots that are unavailable. Default is false.

  • (Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): Period to wait for a connection to the cluster-manager node. If no response is received before the timeout expires, the request fails and returns an error.

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • verbose – If true, returns additional information about each snapshot such as the version of OpenSearch which took the snapshot, the start and end times of the snapshot, and the number of shards snapshotted.

  • repository

  • snapshot

  • params (Any) –

  • headers (Any) –

Return type:

Any

get_repository(repository=None, params=None, headers=None)[source]

Returns information about a repository.

Parameters:
  • repository (Any) – A comma-separated list of repository names

  • cluster_manager_timeout – Operation timeout for connection to cluster-manager node.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • local – Return local information, do not retrieve the state from cluster-manager node. Default is false.

  • (Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): Explicit operation timeout for connection to cluster-manager node

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • repository

  • params (Any) –

  • headers (Any) –

Return type:

Any

restore(repository, snapshot, body=None, params=None, headers=None)[source]

Restores a snapshot.

Parameters:
  • repository (Any) – A repository name

  • snapshot (Any) – A snapshot name

  • body (Any) – Details of what to restore

  • cluster_manager_timeout – Operation timeout for connection to cluster-manager node.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • (Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): Explicit operation timeout for connection to cluster-manager node

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • wait_for_completion – Should this request wait until the operation has completed before returning Default is false.

  • repository

  • snapshot

  • body

  • params (Any) –

  • headers (Any) –

Return type:

Any

status(repository=None, snapshot=None, params=None, headers=None)[source]

Returns information about the status of a snapshot.

Parameters:
  • repository (Any) – A repository name

  • snapshot (Any) – A comma-separated list of snapshot names

  • cluster_manager_timeout – Operation timeout for connection to cluster-manager node.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • ignore_unavailable – Whether to ignore unavailable snapshots, defaults to false which means a SnapshotMissingException is thrown Default is false.

  • (Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): Explicit operation timeout for connection to cluster-manager node

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • repository

  • snapshot

  • params (Any) –

  • headers (Any) –

Return type:

Any

verify_repository(repository, params=None, headers=None)[source]

Verifies a repository.

Parameters:
  • repository (Any) – A repository name

  • cluster_manager_timeout – Operation timeout for connection to cluster-manager node.

  • error_trace – Whether to include the stack trace of returned errors. Default is false.

  • filter_path – Used to reduce the response. This parameter takes a comma-separated list of filters. It supports using wildcards to match any field or part of a field’s name. You can also exclude fields with “-“.

  • human – Whether to return human readable values for statistics. Default is True.

  • (Deprecated (master_timeout) – To promote inclusive language, use cluster_manager_timeout instead.): Explicit operation timeout for connection to cluster-manager node

  • pretty – Whether to pretty format the returned JSON response. Default is false.

  • source – The URL-encoded request definition. Useful for libraries that do not accept a request body for non-POST requests.

  • timeout – Explicit operation timeout

  • repository

  • params (Any) –

  • headers (Any) –

Return type:

Any