只读

编辑

允许的阶段:热、温、冷。

使索引数据变为只读;禁用对索引的数据写入操作。

要在 hot 阶段使用 readonly 操作,rollover 操作必须存在。如果未配置滚动更新操作,ILM 将拒绝该策略。

选项

编辑

无。

示例

编辑
resp = client.ilm.put_lifecycle(
    name="my_policy",
    policy={
        "phases": {
            "warm": {
                "actions": {
                    "readonly": {}
                }
            }
        }
    },
)
print(resp)
response = client.ilm.put_lifecycle(
  policy: 'my_policy',
  body: {
    policy: {
      phases: {
        warm: {
          actions: {
            readonly: {}
          }
        }
      }
    }
  }
)
puts response
const response = await client.ilm.putLifecycle({
  name: "my_policy",
  policy: {
    phases: {
      warm: {
        actions: {
          readonly: {},
        },
      },
    },
  },
});
console.log(response);
PUT _ilm/policy/my_policy
{
  "policy": {
    "phases": {
      "warm": {
        "actions": {
          "readonly" : { }
        }
      }
    }
  }
}