Get lifecycle policies Generally available; Added in 6.6.0

GET /_ilm/policy/{policy}

All methods and paths for this operation:

GET /_ilm/policy

GET /_ilm/policy/{policy}

Required authorization

  • Cluster privileges: manage_ilm,read_ilm

Path parameters

  • policy string Required

    Identifier for the policy.

Query parameters

  • master_timeout string

    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.

    Values are -1 or 0.

  • timeout string

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

    Values are -1 or 0.

Responses

  • 200 application/json
    Hide response attribute Show response attribute object
    • * object Additional properties
      Hide * attributes Show * attributes object
      • modified_date string | number Required

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

        One of:

        Time unit for milliseconds

      • policy object Required
        Hide policy attributes Show policy attributes object
        • phases object Required
          Hide phases attributes Show phases attributes object
          • cold object
            Hide cold attributes Show cold attributes object
            • actions object
              Hide actions attributes Show actions attributes object
              • allocate object
              • delete object
              • downsample object
              • freeze object

                For empty Class assignments

              • forcemerge object
              • migrate object
              • readonly object

                For empty Class assignments

              • rollover object
              • set_priority object
              • searchable_snapshot object
              • shrink object
              • unfollow object

                For empty Class assignments

              • wait_for_snapshot object
            • min_age 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.

          • delete object
            Hide delete attributes Show delete attributes object
            • actions object
              Hide actions attributes Show actions attributes object
              • allocate object
              • delete object
              • downsample object
              • freeze object

                For empty Class assignments

              • forcemerge object
              • migrate object
              • readonly object

                For empty Class assignments

              • rollover object
              • set_priority object
              • searchable_snapshot object
              • shrink object
              • unfollow object

                For empty Class assignments

              • wait_for_snapshot object
            • min_age 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.

          • frozen object
            Hide frozen attributes Show frozen attributes object
            • actions object
              Hide actions attributes Show actions attributes object
              • allocate object
              • delete object
              • downsample object
              • freeze object

                For empty Class assignments

              • forcemerge object
              • migrate object
              • readonly object

                For empty Class assignments

              • rollover object
              • set_priority object
              • searchable_snapshot object
              • shrink object
              • unfollow object

                For empty Class assignments

              • wait_for_snapshot object
            • min_age 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.

          • hot object
            Hide hot attributes Show hot attributes object
            • actions object
              Hide actions attributes Show actions attributes object
              • allocate object
              • delete object
              • downsample object
              • freeze object

                For empty Class assignments

              • forcemerge object
              • migrate object
              • readonly object

                For empty Class assignments

              • rollover object
              • set_priority object
              • searchable_snapshot object
              • shrink object
              • unfollow object

                For empty Class assignments

              • wait_for_snapshot object
            • min_age 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.

          • warm object
            Hide warm attributes Show warm attributes object
            • actions object
              Hide actions attributes Show actions attributes object
              • allocate object
              • delete object
              • downsample object
              • freeze object

                For empty Class assignments

              • forcemerge object
              • migrate object
              • readonly object

                For empty Class assignments

              • rollover object
              • set_priority object
              • searchable_snapshot object
              • shrink object
              • unfollow object

                For empty Class assignments

              • wait_for_snapshot object
            • min_age 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.

        • _meta object
          Hide _meta attribute Show _meta attribute object
          • * object Additional properties
      • version number Required
GET _ilm/policy/my_policy 
resp = client.ilm.get_lifecycle( name="my_policy", )
const response = await client.ilm.getLifecycle({ name: "my_policy", });
response = client.ilm.get_lifecycle( policy: "my_policy" )
$resp = $client->ilm()->getLifecycle([ "policy" => "my_policy", ]);
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ilm/policy/my_policy"
client.ilm().getLifecycle(g -> g .name("my_policy") ); 
Response examples (200)
A successful response when retrieving a lifecycle policy.
{ "my_policy": { "version": 1, "modified_date": 82392349, "policy": { "phases": { "warm": { "min_age": "10d", "actions": { "forcemerge": { "max_num_segments": 1 } } }, "delete": { "min_age": "30d", "actions": { "delete": { "delete_searchable_snapshot": true } } } } }, "in_use_by" : { "indices" : [], "data_streams" : [], "composable_templates" : [] } } }