Snapshot Client

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

Bases: NamespacedClient

Parameters:

client (Any) –

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

Removes any stale data from a snapshot repository.

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

  • cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).

  • 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 – The amount of time to wait for a response.

  • repository

  • params (Any) –

  • headers (Any) –

Return type:

Any

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

Creates a clone of all or part of a snapshot in the same repository as the original snapshot.

Parameters:
  • repository (Any) – The name of repository which will contain the snapshots clone.

  • snapshot (Any) – The name of the original snapshot.

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

  • body (Any) – The snapshot clone definition.

  • cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).

  • 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 within an existing repository.

Parameters:
  • repository (Any) – The name of the repository where the snapshot will be stored.

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

  • body (Any) – The snapshot definition.

  • cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).

  • 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 – When true, the request returns a response when the snapshot is complete. When 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 snapshot repository.

Parameters:
  • repository (Any) – The name for the newly registered repository.

  • body (Any) – The repository definition.

  • cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).

  • 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 – The amount of time to wait for a response.

  • verify – When true, verifies the creation of the snapshot repository.

  • repository

  • body

  • params (Any) –

  • headers (Any) –

Return type:

Any

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

Deletes a snapshot.

Parameters:
  • repository (Any) – The name of the snapshot repository to delete.

  • snapshot (Any) – A comma-separated list of snapshot names to delete from the repository.

  • cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).

  • 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 snapshot repository.

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

  • cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).

  • 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 – The amount of time to wait for a response.

  • repository

  • params (Any) –

  • headers (Any) –

Return type:

Any

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

Returns information about a snapshot.

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

  • snapshot (Any) – A comma-separated list of snapshot names to retrieve. Also accepts wildcard expressions. (*). 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 – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).

  • 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 – When 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 – When 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 contained in the snapshot.

  • repository

  • snapshot

  • params (Any) –

  • headers (Any) –

Return type:

Any

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

Returns information about a snapshot repository.

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

  • cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).

  • 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 – Whether to get information from the local 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) – The name of the repository containing the snapshot

  • snapshot (Any) – The name of the snapshot to restore.

  • body (Any) – Determines which settings and indexes to restore when restoring a snapshot

  • cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).

  • 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 – Whether to return a response after the restore operation has completed. When false, the request returns a response when the restore operation initializes. When true, the request returns a response when the restore operation completes. 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) – The name of the repository containing the snapshot.

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

  • cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).

  • 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 any unavailable snapshots, When false, 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) – The name of the repository containing the snapshot.

  • cluster_manager_timeout – The amount of time to wait for a response from the cluster manager node. For more information about supported time units, see [Common parameters](https://opensearch.org/docs/latest/api-reference/common- parameters/#time-units).

  • 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 – The amount of time to wait for a response.

  • repository

  • params (Any) –

  • headers (Any) –

Return type:

Any