Create a snapshot Added in 0.0.0

PUT /_snapshot/{repository}/{snapshot}

Take a snapshot of a cluster or of data streams and indices.

Path parameters

  • repository string Required

    Repository for the snapshot.

  • snapshot string Required

    Name of the snapshot. Must be unique in the repository.

Query parameters

  • Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error.

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

application/json

Body

  • If true, the request ignores data streams and indices in indices that are missing or closed. If false, the request returns an error for any data stream or index that is missing or closed.

  • If true, the current cluster state is included in the snapshot. The cluster state includes persistent cluster settings, composable index templates, legacy index templates, ingest pipelines, and ILM policies. It also includes data stored in system indices, such as Watches and task records (configurable via feature_states).

  • indices string | array[string]
  • feature_states array[string]

    Feature states to include in the snapshot. Each feature state includes one or more system indices containing related data. You can view a list of eligible features using the get features API. If include_global_state is true, all current feature states are included by default. If include_global_state is false, no feature states are included by default.

  • metadata object
    Hide metadata attribute Show metadata attribute object
    • * object Additional properties

      Additional properties are allowed.

  • partial boolean

    If true, allows restoring a partial snapshot of indices with unavailable shards. Only shards that were successfully included in the snapshot will be restored. All missing shards will be recreated as empty. If false, the entire restore operation will fail if one or more indices included in the snapshot do not have all primary shards available.

Responses

PUT /_snapshot/{repository}/{snapshot}
curl \
 -X PUT http://api.example.com/_snapshot/{repository}/{snapshot} \
 -H "Content-Type: application/json" \
 -d '{"ignore_unavailable":true,"include_global_state":true,"indices":"string","feature_states":["string"],"metadata":{"additionalProperty1":{},"additionalProperty2":{}},"partial":true}'
Request examples
{
  "ignore_unavailable": true,
  "include_global_state": true,
  "indices": "string",
  "feature_states": [
    "string"
  ],
  "metadata": {
    "additionalProperty1": {},
    "additionalProperty2": {}
  },
  "partial": true
}
Response examples (200)
{
  "accepted": true,
  "snapshot": {
    "data_streams": [
      "string"
    ],
    "duration": "string",
    "": 42.0,
    "failures": [
      {
        "index": "string",
        "node_id": "string",
        "reason": "string",
        "shard_id": "string",
        "index_uuid": "string",
        "status": "string"
      }
    ],
    "include_global_state": true,
    "indices": [
      "string"
    ],
    "index_details": {
      "additionalProperty1": {
        "shard_count": 42.0,
        "": 42.0,
        "size_in_bytes": 42.0,
        "max_segments_per_shard": 42.0
      },
      "additionalProperty2": {
        "shard_count": 42.0,
        "": 42.0,
        "size_in_bytes": 42.0,
        "max_segments_per_shard": 42.0
      }
    },
    "metadata": {
      "additionalProperty1": {},
      "additionalProperty2": {}
    },
    "reason": "string",
    "repository": "string",
    "snapshot": "string",
    "shards": {
      "failed": 42.0,
      "successful": 42.0,
      "total": 42.0,
      "failures": [
        {
          "index": "string",
          "node": "string",
          "reason": {
            "type": "string",
            "reason": "string",
            "stack_trace": "string",
            "caused_by": {},
            "root_cause": [
              {}
            ],
            "suppressed": [
              {}
            ]
          },
          "shard": 42.0,
          "status": "string"
        }
      ],
      "skipped": 42.0
    },
    "state": "string",
    "uuid": "string",
    "version": "string",
    "version_id": 42.0,
    "feature_states": [
      {
        "feature_name": "string",
        "indices": "string"
      }
    ]
  }
}