Commit Graph

4 Commits

Author SHA1 Message Date
Andrei Dan 731e6dd097
GET _lifecycle returns data streams without lifecycle (#95192)
This changes the `GET _data_stream/ds_name/_lifecycle` endpoint to
return the data stream name even if it doesn't have a lifecycle
configured.

e.g.
```
{
  "data_streams": [
    {
      "name": "logs-nginx"
    }
  ]
}
```

* Fix xcontent and tests

* Update docs

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2023-04-17 10:35:22 +01:00
Andrei Dan 83402605ea
Remove the lifecycle field in the PUT _lifecycle request (#95201)
This removes a redundant `lifecycle` field in the `PUT _lifecycle`
request.

Before we had
```
PUT _data_stream/logs-nginx/_lifecycle
{
    "lifecycle": {
        "data_retention": "7d"
    }
}
```

This changes the request to
```
PUT _data_stream/logs-nginx/_lifecycle
{
  "data_retention": "7d"
}
```
2023-04-13 09:12:48 +01:00
Mary Gouseti 99145bbe9c
Add new endpoints to configure data lifecycle on a data stream level. (#94590)
With PR we introduce CRUD endpoints which update/delete the data lifecycle on the data stream level. When this is updated it will apply at the next DLM run to all the backing indices that are managed by DLM.
2023-04-04 18:37:38 +02:00
Andrei Dan 223385f887
Introduce a _lifecycle/explain API for data stream backing indices (#94621)
This adds an {index}/_lifecycle/explain API to retrieve information
about an index's status within its lifecycle.

The response looks like so:
```
"indices" : {
    ".ds-metrics-foo-2023.03.22-000001" : {
      "index" : ".ds-metrics-foo-2023.03.22-000001",
      "managed_by_dlm" : true,
      "index_creation_date_millis" : 1679475563571,
      "time_since_index_creation" : "843ms",
      "rollover_date_millis" : 1679475564293,
      "time_since_rollover" : "121ms",
      "lifecycle" : { },
      "generation_time" : "121ms"
    },
    ".ds-metrics-foo-2023.03.22-000002" : {
      "index" : ".ds-metrics-foo-2023.03.22-000002",
      "managed_by_dlm" : true,
      "index_creation_date_millis" : 1679475564351,
      "time_since_index_creation" : "63ms",
      "lifecycle" : { }
    }
  }
}
```
2023-03-27 08:44:40 +01:00