Skip to content

Commit 71c70ca

Browse files
committed
Support ReindexRethrottle
Update rest api specs to 2.4.0 Patch documentation for RequestsPerSecond to indicate that float.PositiveInfinity should be used to set no throttle. Per elastic/elasticsearch#20625, the spec indicates that it supports 0 for no throttle but Elasticsearch does not allow this, so special case float.PositiveInfinity to "unlimited". Similarly, on the response, convert "unlimited" to float.PositiveInfinity.
1 parent 1ecaf8d commit 71c70ca

File tree

135 files changed

+14148
-13614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

135 files changed

+14148
-13614
lines changed

src/CodeGeneration/ApiGenerator/Domain/ApiQueryParameters.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,15 @@ public string CsharpType(string paramName)
2828
return "params string[]";
2929
case "integer":
3030
case "number":
31-
return new [] {"boost", "percen", "score"}.Any(s=>paramName.ToLowerInvariant().Contains(s))
32-
? "double"
33-
: "long";
31+
if (new[] { "boost", "percen", "score" }.Any(s => paramName.ToLowerInvariant().Contains(s)))
32+
{
33+
return "double";
34+
}
35+
if (new[] { "requests_per_second" }.Any(s => paramName.ToLowerInvariant().Contains(s)))
36+
{
37+
return "float";
38+
}
39+
return "long";
3440
case "duration":
3541
case "time":
3642
return "TimeSpan";

src/CodeGeneration/ApiGenerator/Overrides/Descriptors/ReindexRethrottleDescriptorOverrides.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ public override CsharpMethod PatchMethod(CsharpMethod method)
99
{
1010
var requestParam = method.Url.Params.First(p => p.Key == "requests_per_second");
1111

12+
requestParam.Value.Description = "The throttle to set on this request in sub-requests per second. float.PositiveInfinity means set no throttle.";
13+
1214
//Handle float.PositiveInfinity as though "unlimited"
1315
requestParam.Value.Generator = (fieldType, mm, original, setter) =>
1416
$"public {fieldType} {mm} {{ " +

src/CodeGeneration/ApiGenerator/RestSpecification/Core/bulk.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"bulk": {
3-
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/2.3/docs-bulk.html",
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/docs-bulk.html",
44
"methods": ["POST", "PUT"],
55
"url": {
66
"path": "/_bulk",

src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.aliases.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cat.aliases": {
3-
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-alias.html",
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-alias.html",
44
"methods": ["GET"],
55
"url": {
66
"path": "/_cat/aliases",

src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.allocation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cat.allocation": {
3-
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-allocation.html",
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-allocation.html",
44
"methods": ["GET"],
55
"url": {
66
"path": "/_cat/allocation",

src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.count.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cat.count": {
3-
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-count.html",
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-count.html",
44
"methods": ["GET"],
55
"url": {
66
"path": "/_cat/count",

src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.fielddata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cat.fielddata": {
3-
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-fielddata.html",
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-fielddata.html",
44
"methods": ["GET"],
55
"url": {
66
"path": "/_cat/fielddata",

src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.health.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cat.health": {
3-
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-health.html",
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-health.html",
44
"methods": ["GET"],
55
"url": {
66
"path": "/_cat/health",

src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.help.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cat.help": {
3-
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat.html",
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat.html",
44
"methods": ["GET"],
55
"url": {
66
"path": "/_cat",

src/CodeGeneration/ApiGenerator/RestSpecification/Core/cat.indices.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"cat.indices": {
3-
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/2.3/cat-indices.html",
3+
"documentation": "http://www.elastic.co/guide/en/elasticsearch/reference/master/cat-indices.html",
44
"methods": ["GET"],
55
"url": {
66
"path": "/_cat/indices",

0 commit comments

Comments
 (0)