Skip to content
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

Index Lifecycle Management Policy API #1105

Merged
merged 10 commits into from
Jun 6, 2019

Conversation

aarontami
Copy link
Contributor

Add some API calls for Index Lifecycle Management:

  1. Create a policy
  2. Get a policy
  3. Delete a policy

These API calls are also present in the Java client.

Index Lifecycle Management is supported in version 6.7 and above (non beta), so adding this to v6.

@aarontami
Copy link
Contributor Author

@olivere

@aarontami
Copy link
Contributor Author

aarontami commented May 31, 2019

Travis seems to not be accepting any _ilm calls, which makes me think maybe version 6.7 isn't running on it? When im running 6.7 these tests pass locally.

@aarontami aarontami changed the title Lifecycle policy Index Lifecycle Management Policy API May 31, 2019
@olivere
Copy link
Owner

olivere commented Jun 3, 2019

Happy to see this integrated into Elastic. The problem with the ILM API is that it's not available in the open source version AFAIK. In v6 and v7 we have two docker images running in TravisCI (here's v6): the OSS docker image and the platinum version, available at different ports and with different user/password. You need to use the correct client; see the tests in e.g. XPack Security API.

What I'm not sure is if ILM is available in the Platinum image with a trial license installed. If we can't test the XPack ILM API, we need to skip the tests on TravisCI, e.g. by checking if the given feature is available:

	xi, err := client.XPackInfo().Do(context.Background())
	if err != nil {
		t.Fatal(err)
	}
	if !xi.Features.Security.Enabled {
		t.Skip("skip due to deactivated xpack security")
	}

Description of features is here.

Copy link
Owner

@olivere olivere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please double check the request/response data from the XPack REST API and (if necessary) their Java implementation.

Can we also please rename ilm_... to xpack_ilm_... and ilm_lifecycle_test.go to xpack_ilm_test.go?

client.go Outdated Show resolved Hide resolved
@olivere
Copy link
Owner

olivere commented Jun 3, 2019

Oh. According to https://www.elastic.co/de/subscriptions we should be able to at least test XPack ILM API. We should probably enable it in docker-compose.yml with - xpack.ilm.enabled=true.

@aarontami
Copy link
Contributor Author

Thanks for the review.

  • Changed the file names to start with xpack_* as indicated. Also changed all the class names to start with XPack, as seemed to be the convention with all the other XPack apis.
  • Changed the test to use 9210 like the other xpack tests, so it will hit the other travis docker image
  • Enabled ilm in the docker yml

@aarontami aarontami closed this Jun 4, 2019
@aarontami aarontami reopened this Jun 4, 2019
Copy link
Owner

@olivere olivere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a tiny thing left before I can merge. I'll port it to release-branch.v7 as well when it's done.

xpack_ilm_put_lifecycle.go Outdated Show resolved Hide resolved
@aarontami
Copy link
Contributor Author

@olivere thanks for quick review, do you have any idea when you'll cut new releases so we can start using this?

Thanks

@olivere
Copy link
Owner

olivere commented Jun 4, 2019

@aarontami It'll probably take at least until the weekend.

Copy link
Owner

@olivere olivere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

@olivere olivere merged commit 9d31960 into olivere:release-branch.v6 Jun 6, 2019
@olivere olivere added this to the 6.2.19 milestone Jun 6, 2019
olivere added a commit that referenced this pull request Jun 6, 2019
This commit adds the Index Lifecycle Management Policy API
to v7.

It is a cherry-pick of #1105 on release-branch.v6.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants