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

Implement Index Lifecycle APIs #3671

Merged
merged 35 commits into from
May 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
dd2b86f
ILM start API
codebrain Apr 4, 2019
3a01dc2
ILM Stop API
codebrain Apr 4, 2019
f7ed7f2
ILM Get Status API
codebrain Apr 4, 2019
d1b38f4
Create OperationMode as enum
codebrain Apr 5, 2019
6bb99f3
Patch ILM Start API
codebrain Apr 5, 2019
d3a423c
Patch ILM Stop
codebrain Apr 5, 2019
dfb48b2
Patch ILM Get Status
codebrain Apr 5, 2019
98c2fd4
Get ILM Lifecycle API
codebrain Apr 9, 2019
b38ba07
Delete Lifecycle ILM API
codebrain Apr 9, 2019
a52bed5
Retry ILM API
codebrain Apr 9, 2019
66347e8
Move To Step ILM API
codebrain Apr 10, 2019
aa2d264
Remove Policy ILM API
codebrain Apr 10, 2019
6b1c948
Patch JSON files to mark URL parameters as required
codebrain Apr 10, 2019
345996a
Explain Lifecycle ILM API
codebrain Apr 11, 2019
ecb21a3
First pass at descriptors for Put Lifecycle API
codebrain Apr 12, 2019
a65a765
Rename policy to policy_id in the url part
codebrain Apr 15, 2019
69a314b
Start of ILM tests
codebrain Apr 15, 2019
910ba56
Fix compile error
codebrain Apr 16, 2019
d605601
Put Lifecycle implementation and test
codebrain Apr 29, 2019
e393d44
Refactoring
codebrain May 1, 2019
9934484
Integration tests
codebrain May 3, 2019
37b7779
Set nullability on lifecycle actions
codebrain May 3, 2019
3c54c94
Set nullability on lifecycle actions
codebrain May 3, 2019
45bf76e
Patch /_ilm/policy endpoint in REST specification, Add Urltests, Add …
codebrain May 6, 2019
7daec49
Update src/Nest/XPack/Ilm/Actions/ForceMergeAction.cs
russcam May 7, 2019
840da98
Update src/Nest/XPack/Ilm/Actions/ForceMergeAction.cs
russcam May 7, 2019
b19d376
Update src/Nest/XPack/Ilm/Actions/ForceMergeAction.cs
russcam May 7, 2019
43b5f1a
Update src/Nest/XPack/Ilm/ExplainLifecycle/IlmExplainLifecycleRespons…
russcam May 7, 2019
be6c14d
Rename OperationMode to LifecycleOperationMode
codebrain May 7, 2019
f6d0d58
Update src/Nest/XPack/Ilm/Actions/ForceMergeAction.cs
russcam May 7, 2019
eefbc6a
Update src/Nest/XPack/Ilm/Actions/ForceMergeAction.cs
russcam May 7, 2019
854db46
Add XML comments for actions
codebrain May 7, 2019
a8b633b
Merge
codebrain May 7, 2019
e981eee
Rename Api endpoints and add Xpack prefix to low level client
codebrain May 7, 2019
16c6ddd
Merge 'origin/6.7' into feature/ilm-apis
codebrain May 7, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
363 changes: 0 additions & 363 deletions .paket/Paket.Restore.targets

This file was deleted.

15 changes: 3 additions & 12 deletions src/CodeGeneration/ApiGenerator/ApiGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ public class ApiGenerator
{
"ccr.follow_info.json",
"ccr.forget_follower.json",
"ilm.delete_lifecycle.json",
"ilm.explain_lifecycle.json",
"ilm.get_lifecycle.json",
"ilm.get_status.json",
"ilm.move_to_step.json",
"ilm.put_lifecycle.json",
"ilm.remove_policy.json",
"ilm.retry.json",
"ilm.start.json",
"ilm.stop.json",
"indices.freeze.json",
"indices.unfreeze.json",
"xpack.ml.set_upgrade_mode.json",
Expand Down Expand Up @@ -179,9 +169,10 @@ private static Dictionary<string, ApiQueryParameters> CreateCommonApiQueryParame
private static string CreateMethodName(string apiEndpointKey)
{
var pascalCased = PascalCase(apiEndpointKey);
if (pascalCased.StartsWith("Security"))
if (pascalCased.StartsWith("Security")
|| pascalCased.StartsWith("Ilm"))
{
pascalCased = "Xpack" + pascalCased;
return "Xpack" + pascalCased;
}
return pascalCased;
}
Expand Down
2 changes: 1 addition & 1 deletion src/CodeGeneration/ApiGenerator/Domain/ApiUrlPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public string ClrTypeName
case "filter_id":
case "id": return Type == "string" ? "Id" : "Ids";
case "category_id": return "CategoryId";
case "policy_id": return "PolicyId";
case "forecast_id": return "ForecastIds";
case "nodes":
case "node_id": return Type == "string" ? "NodeId" : "NodeIds";
Expand Down Expand Up @@ -109,7 +110,6 @@ public string InterfaceName
public bool Required { get; set; }
public string Type { get; set; }


private string CleanUpDescription(string value)
{
if (string.IsNullOrWhiteSpace(value)) return value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ public abstract class EndpointOverridesBase : IEndpointOverrides
public virtual IDictionary<string, string> RenameQueryStringParams { get; } = new Dictionary<string, string>();

public virtual IEnumerable<string> RenderPartial { get; } = Enumerable.Empty<string>();
public virtual IEnumerable<string> SkipQueryStringParams { get; } = Enumerable.Empty<string>();

public virtual IEnumerable<string> SkipQueryStringParams { get; } = Enumerable.Empty<string>();

public virtual CsharpMethod PatchMethod(CsharpMethod method) => method;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"ilm.delete_lifecycle": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-delete-lifecycle.html",
"methods": [ "DELETE" ],
"url": {
"path": "/_ilm/policy/{policy_id}",
"paths": ["/_ilm/policy/{policy_id}"],
"parts": {
"policy_id": {
"type" : "string",
"description" : "The name of the index lifecycle policy",
"required": true
}
},
"params": {
"master_timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
},
"timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
}
}
},
"body": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"ilm.explain_lifecycle": {
"url": {
"parts": {
"index": {
"required": true
}
},
"params": {
"master_timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
},
"timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"ilm.get_lifecycle": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-get-lifecycle.html",
"methods": [ "GET" ],
"url": {
"path": "/_ilm/policy/{policy_id}",
"paths": ["/_ilm/policy/{policy_id}", "/_ilm/policy"],
"parts": {
"policy_id": {
"type" : "string",
"description" : "The name of the index lifecycle policy"
}
},
"params": {
"master_timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
},
"timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
}
}
},
"body": null
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"ilm.get_status": {
"url": {
"params": {
"master_timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
},
"timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"ilm.move_to_step": {
"url": {
"parts": {
"index": {
"required": true
}
},
"params": {
"master_timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
},
"timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"ilm.put_lifecycle": {
"documentation": "https://www.elastic.co/guide/en/elasticsearch/reference/current/ilm-put-lifecycle.html",
"methods": [ "PUT" ],
"url": {
"path": "/_ilm/policy/{policy_id}",
"paths": ["/_ilm/policy/{policy_id}"],
"parts": {
"policy_id": {
"type" : "string",
"description" : "The name of the index lifecycle policy",
"required": true
}
},
"params": {
"master_timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
},
"timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
}
}
},
"body": {
"description": "The lifecycle policy definition to register"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"ilm.remove_policy": {
"url": {
"parts": {
"index": {
"required": true
}
},
"params": {
"master_timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
},
"timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"ilm.retry": {
"url": {
"parts": {
"index": {
"required": true
}
},
"params": {
"master_timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
},
"timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"ilm.start": {
"url": {
"params": {
"master_timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
},
"timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"ilm.stop": {
"url": {
"params": {
"master_timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
},
"timeout": {
"type" : "time",
"description" : "Specifies the period of time to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s."
}
}
}
}
}
Loading