add notion of version and creation_date to LifecyclePolicyMetadata#33450
add notion of version and creation_date to LifecyclePolicyMetadata#33450talevy merged 3 commits intoelastic:index-lifecyclefrom
Conversation
|
Pinging @elastic/es-core-infra |
ce3a034 to
0b0bba4
Compare
It is useful to keep track of which version of a policy is currently being executed by a specific index. For management purposes, it would also be useful to know at which time the latest version was inserted so that an audit trail is left for reconciling changes happening in ILM.
| public static class Response extends ActionResponse implements ToXContentObject { | ||
|
|
||
| private List<LifecyclePolicy> policies; | ||
| private Map<LifecyclePolicy, Tuple<Long, String>> policiesToMetadata; |
There was a problem hiding this comment.
I think we should make this nicer here. Having a map is not nice because the key is not something you are realistically going to to use to lookup things and Tuples are generally not particularly nice to consume. Can we create a wrapper class around the policy, date and version so we have an object that is easier to consume both for us internally and for users of the transport API (given this class will be exposed to the Transport API)?
|
thanks @colings86, I've updated to use a proper class |
| for (LifecyclePolicyMetadata policyMetadata : requestedPolicies) { | ||
| responseItems.add(new LifecyclePolicyResponseItem(policyMetadata.getPolicy(), | ||
| policyMetadata.getVersion(), policyMetadata.getCreationDateString())); | ||
| } |
There was a problem hiding this comment.
Can we not create the list of LifecyclePolicyResponseItem directly rather than first creating the list of LifecyclePolicyMetadata?
colings86
left a comment
There was a problem hiding this comment.
LGTM if the comment I left is solved
…33450) It is useful to keep track of which version of a policy is currently being executed by a specific index. For management purposes, it would also be useful to know at which time the latest version was inserted so that an audit trail is left for reconciling changes happening in ILM.
It is useful to keep track of which version of a policy is currently
being executed by a specific index. For management purposes, it would
also be useful to know at which time the latest version was inserted
so that an audit trail is left for reconciling changes happening in ILM.
The work here only adds a notion of version and creation_date to the lifecycle-metadata. The index settings are not updated with which version their currently executed
phase_definitionis because these settings are to be moved to custom indexmetadata anyways, and I would prefer to minimize conflicts here, happy to do this in a follow-up if the time is right.