Get policy information Generally available; Added in 7.4.0

GET /_slm/policy/{policy_id}

All methods and paths for this operation:

GET /_slm/policy

GET /_slm/policy/{policy_id}

Get snapshot lifecycle policy definitions and information about the latest snapshot attempts.

Required authorization

  • Cluster privileges: manage_slm

Path parameters

  • policy_id string | array[string] Required

    A comma-separated list of snapshot lifecycle policy identifiers.

Query parameters

  • master_timeout string

    The 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.

    External documentation
  • timeout string

    The period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error.

    External documentation

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • * object Additional properties
      Hide * attributes Show * attributes object
      • in_progress object
        Hide in_progress attributes Show in_progress attributes object
        • name string
        • state string Required
        • uuid string
      • last_failure object
        Hide last_failure attributes Show last_failure attributes object
        • snapshot_name string
        • time
      • last_success object
        Hide last_success attributes Show last_success attributes object
        • snapshot_name string
        • time
      • modified_date string | number

        The last time the policy was modified.

        One of:

        Time unit for milliseconds

      • modified_date_millis number Required

        Time unit for milliseconds

      • next_execution string | number

        The next time the policy will run.

        One of:

        Time unit for milliseconds

      • next_execution_millis number Required

        Time unit for milliseconds

      • policy object Required
        Hide policy attributes Show policy attributes object
        • config object
        • name string
        • repository string Required
        • retention object
        • schedule string
      • version number Required

        The version of the snapshot policy. Only the latest version is stored and incremented when the policy is updated.

      • stats object Required
        Hide stats attributes Show stats attributes object
        • retention_deletion_time string

          A duration. Units can be nanos, micros, ms (milliseconds), s (seconds), m (minutes), h (hours) and d (days). Also accepts "0" without a unit and "-1" to indicate an unspecified value.

        • retention_failed number
        • retention_runs number
        • retention_timed_out number
        • policy string
        • total_snapshots_deleted number
        • total_snapshot_deletion_failures number
        • total_snapshots_failed number
        • total_snapshots_taken number
GET /_slm/policy/{policy_id}
GET _slm/policy/daily-snapshots?human
resp = client.slm.get_lifecycle(
    policy_id="daily-snapshots",
    human=True,
)
const response = await client.slm.getLifecycle({
  policy_id: "daily-snapshots",
  human: "true",
});
response = client.slm.get_lifecycle(
  policy_id: "daily-snapshots",
  human: "true"
)
$resp = $client->slm()->getLifecycle([
    "policy_id" => "daily-snapshots",
    "human" => "true",
]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_slm/policy/daily-snapshots?human"
Response examples (200)
A successful response from `GET _slm/policy/daily-snapshots?human`.
{
  "daily-snapshots": {
    "version": 1,
    "modified_date": "2099-05-06T01:30:00.000Z",
    "modified_date_millis": 4081757400000,
    "policy" : {
      "schedule": "0 30 1 * * ?",
      "name": "<daily-snap-{now/d}>",
      "repository": "my_repository",
      "config": {
        "indices": ["data-*", "important"],
        "ignore_unavailable": false,
        "include_global_state": false
      },
      "retention": {
        "expire_after": "30d",
        "min_count": 5,
        "max_count": 50
      }
    },
    "stats": {
      "policy": "daily-snapshots",
      "snapshots_taken": 0,
      "snapshots_failed": 0,
      "snapshots_deleted": 0,
      "snapshot_deletion_failures": 0
    },
    "next_execution": "2099-05-07T01:30:00.000Z",
    "next_execution_millis": 4081843800000
  }
}