获取生命周期策略 API
编辑获取生命周期策略 API
编辑检索生命周期策略。
描述
编辑返回指定的策略定义。包括策略版本和上次修改日期。如果未指定策略,则返回所有已定义的策略。
路径参数
编辑-
<policy_id>
- (可选,字符串)策略的标识符。
查询参数
编辑示例
编辑以下示例检索 my_policy
resp = client.ilm.get_lifecycle( name="my_policy", ) print(resp)
response = client.ilm.get_lifecycle( policy: 'my_policy' ) puts response
const response = await client.ilm.getLifecycle({ name: "my_policy", }); console.log(response);
GET _ilm/policy/my_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" : [] } } }