Skip to content

Commit

Permalink
Add remarks about when cluster_manager_timeout is supported
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Farr <tsfarr@amazon.com>
  • Loading branch information
Xtansia committed Aug 23, 2023
1 parent 41e7980 commit 5b64ea6
Show file tree
Hide file tree
Showing 10 changed files with 236 additions and 113 deletions.
6 changes: 4 additions & 2 deletions src/ApiGenerator/Domain/Specification/QueryParameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ public class QueryParameters

public string Description { get; set; }

public string VersionAdded { get; set; }

public IEnumerable<string> DescriptionHighLevel
{
get
Expand Down Expand Up @@ -191,8 +193,8 @@ public string TypeLowLevel
}


public string InitializerGenerator(string @namespace, string type, string name, string key, string setter, params string[] doc) =>
CodeGenerator.Property(@namespace, type, name, key, setter, Obsolete, doc);
public string InitializerGenerator(string @namespace, string type, string name, string key, string setter, string versionAdded, params string[] doc) =>
CodeGenerator.Property(@namespace, type, name, key, setter, Obsolete, versionAdded, doc);
}

public class QueryParameterDeprecation
Expand Down
3 changes: 2 additions & 1 deletion src/ApiGenerator/Generator/ApiEndpointFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ public static ApiEndpoint From(string name, List<(string HttpPath, OpenApiPathIt
Type = GetOpenSearchType(p.Schema),
Description = p.Description,
Options = GetEnumOptions(p.Schema),
Deprecated = GetDeprecation(p.Schema)
Deprecated = GetDeprecation(p.Schema),
VersionAdded = p.Schema.GetExtension("x-version-added") as string,
});

var endpoint = new ApiEndpoint
Expand Down
3 changes: 2 additions & 1 deletion src/ApiGenerator/Generator/CodeGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ public static string CatFormatPropertyGenerator(string type, string name, string
public static string PropertyGenerator(string type, string name, string key, string setter) =>
$"public {type} {name} {{ get => Q<{type}>(\"{key}\"); set => Q(\"{key}\", {setter}); }}";

public static string Property(string @namespace, string type, string name, string key, string setter, string obsolete, params string[] doc)
public static string Property(string @namespace, string type, string name, string key, string setter, string obsolete, string versionAdded, params string[] doc)
{
var components = new List<string>();
foreach (var d in RenderDocumentation(doc)) A(d);
if (!string.IsNullOrWhiteSpace(versionAdded)) A($"///<remarks>Supported by OpenSearch servers of version {versionAdded} or greater.</remarks>");
if (!string.IsNullOrWhiteSpace(obsolete)) A($"[Obsolete(\"{obsolete}\")]");

var generated = @namespace != null && @namespace == "Cat" && name == "Format"
Expand Down
318 changes: 212 additions & 106 deletions src/ApiGenerator/OpenSearch.openapi.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@
var desc = param.DescriptionHighLevel.ToList();

await IncludeAsync("HighLevel/Descriptors/XmlDocs.cshtml", desc);
if(!string.IsNullOrWhiteSpace(param.Obsolete))

if (!string.IsNullOrWhiteSpace(param.VersionAdded))
{
<text>
///<remarks>Supported by OpenSearch servers of version @(param.VersionAdded) or greater.</remarks></text>
}

if(!string.IsNullOrWhiteSpace(param.Obsolete))
{
<text>
[Obsolete("@Raw(param.Obsolete)")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
continue;
}
var doc = param.DescriptionHighLevel.ToArray();
@Raw(param.InitializerGenerator(Model.CsharpNames.Namespace, param.TypeHighLevel, param.ClsName, original, param.SetterHighLevel, doc))
@Raw(param.InitializerGenerator(Model.CsharpNames.Namespace, param.TypeHighLevel, param.ClsName, original, param.SetterHighLevel, param.VersionAdded, doc))
}
@if (Model.CsharpNames.DescriptorNotFoundInCodebase)
{<text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace OpenSearch.Net@(ns)
public override bool SupportsBody => @(supportsBody ? "true" : "false");
@foreach (var param in r.Params)
{
<text> @Raw(param.InitializerGenerator(r.CsharpNames.Namespace, param.TypeLowLevel, param.ClsName, param.QueryStringKey, param.SetterLowLevel, param.Description))
<text> @Raw(param.InitializerGenerator(r.CsharpNames.Namespace, param.TypeLowLevel, param.ClsName, param.QueryStringKey, param.SetterLowLevel, param.VersionAdded, param.Description))
</text>
}
}</text>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ public DeleteDanglingIndexDescriptor AcceptDataLoss(bool? acceptdataloss = true)
Qs("accept_data_loss", acceptdataloss);

///<summary>Operation timeout for connection to cluster-manager node.</summary>
///<remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
public DeleteDanglingIndexDescriptor ClusterManagerTimeout(Time clustermanagertimeout) =>
Qs("cluster_manager_timeout", clustermanagertimeout);

Expand Down Expand Up @@ -134,6 +135,7 @@ public ImportDanglingIndexDescriptor AcceptDataLoss(bool? acceptdataloss = true)
Qs("accept_data_loss", acceptdataloss);

///<summary>Operation timeout for connection to cluster-manager node.</summary>
///<remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
public ImportDanglingIndexDescriptor ClusterManagerTimeout(Time clustermanagertimeout) =>
Qs("cluster_manager_timeout", clustermanagertimeout);

Expand Down
2 changes: 2 additions & 0 deletions src/OpenSearch.Client/_Generated/Requests.DanglingIndices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public bool? AcceptDataLoss
}

///<summary>Operation timeout for connection to cluster-manager node.</summary>
///<remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
public Time ClusterManagerTimeout
{
get => Q<Time>("cluster_manager_timeout");
Expand Down Expand Up @@ -162,6 +163,7 @@ public bool? AcceptDataLoss
}

///<summary>Operation timeout for connection to cluster-manager node.</summary>
///<remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
public Time ClusterManagerTimeout
{
get => Q<Time>("cluster_manager_timeout");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public bool? AcceptDataLoss
}

///<summary>Operation timeout for connection to cluster-manager node.</summary>
///<remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
public TimeSpan ClusterManagerTimeout

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / compile

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (2.5.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (2.9.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Canary

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (2.8.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (2.4.1)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (1.2.4)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (2.0.1)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (2.1.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (2.3.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (1.1.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (1.3.11)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (2.7.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (2.2.1)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / YAML Tests (Released OpenSearch) (2.6.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch (2.6.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Unit

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / YAML Tests (Released OpenSearch) (1.3.11)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / YAML Tests (Released OpenSearch) (2.9.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Create Release Artifacts

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / YAML Tests (Unreleased OpenSearch) (1.x)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / YAML Tests (Released OpenSearch) (2.4.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / YAML Tests (Released OpenSearch) (2.2.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / YAML Tests (Released OpenSearch) (1.2.4)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / YAML Tests (Released OpenSearch) (2.8.0)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch Unreleased (1.x)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / YAML Tests (Unreleased OpenSearch) (2.x)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch Unreleased (2.x)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / YAML Tests (Unreleased OpenSearch) (main)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'

Check failure on line 71 in src/OpenSearch.Net/_Generated/Api/RequestParameters/RequestParameters.DanglingIndices.cs

View workflow job for this annotation

GitHub Actions / Integration OpenSearch Unreleased (main)

The type 'DeleteDanglingIndexRequestParameters' already contains a definition for 'ClusterManagerTimeout'
{
get => Q<TimeSpan>("cluster_manager_timeout");
Expand Down Expand Up @@ -106,6 +107,7 @@ public bool? AcceptDataLoss
}

///<summary>Operation timeout for connection to cluster-manager node.</summary>
///<remarks>Supported by OpenSearch servers of version 2.0.0 or greater.</remarks>
public TimeSpan ClusterManagerTimeout
{
get => Q<TimeSpan>("cluster_manager_timeout");
Expand Down

0 comments on commit 5b64ea6

Please sign in to comment.