-
Notifications
You must be signed in to change notification settings - Fork 25.2k
add notion of version and creation_date to LifecyclePolicyMetadata #33450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@talevy I left a comment, I think we need to have a proper class int he response rather than trying to use Maps and Tuples
@@ -37,42 +38,49 @@ public Response newResponse() { | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we not create the list of LifecyclePolicyResponseItem
directly rather than first creating the list of LifecyclePolicyMetadata
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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_definition
is 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.