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

Re-generate the root namespace #804

Merged
merged 8 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
54 changes: 50 additions & 4 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
* [1.x.y to 2.0.0](#1xy-to-200)
* [OpenSearch.Net](#opensearchnet)
* [General](#general)
* [Bulk Action](#bulk-action)
* [DeleteByQuery Action](#deletebyquery-action)
* [ReindexOnServer Action](#reindexonserver-action)
* [Search Action](#search-action)
* [UpdateByQuery Action](#updatebyquery-action)
* [Cat.Help Action](#cathelp-action)
* [Cat.Indices Action](#catindices-action)
* [Cat.Master Action](#catmaster-action)
Expand All @@ -11,24 +16,33 @@
* [Cluster.ExistsComponentTemplate Action](#clusterexistscomponenttemplate-action)
* [Cluster.Health Action](#clusterhealth-action)
* [Cluster.PostVotingConfigExclusions Action](#clusterpostvotingconfigexclusions-action)
* [Cluster.Reroute Action](#clusterreroute-action)
* [Features Namespace](#features-namespace)
* [Indices.AddBlock Action](#indicesaddblock-action)
* [Indices.Analyze Action](#indicesanalyze-action)
* [Indices.ClearCache Action](#indicesclearcache-action)
* [Indices.DeleteTemplateV2 Action](#indicesdeletetemplatev2-action)
* [Indices.ExistsTemplate Action](#indicesexiststemplate-action)
* [Indices.GetTemplateV2 Action](#indicesgettemplatev2-action)
* [Indices.PutTemplateV2 Action](#indicesputtemplatev2-action)
* [Indices.ShardStores Action](#indicesshardstores-action)
* [Indices.Stats Action](#indicesstats-action)
* [Nodes.HotThreads Action](#nodeshotthreads-action)
* [Nodes.Stats Action](#nodesstats-action)
* [Snapshot.CleanupRepository Action](#snapshotcleanuprepository-action)
* [Tasks.List Action](#taskslist-action)
* [OpenSearch.Client](#opensearchclient)
* [General](#general-1)
* [Bulk Action](#bulk-action-1)
* [UpdateByQuery Action](#updatebyquery-action-1)
* [Cat.Help Action](#cathelp-action-1)
* [Cat.Indices Action](#catindices-action-1)
* [Cat.Master Action](#catmaster-action-1)
* [Cat.Plugins Action](#catplugins-action-1)
* [Cluster.GetComponentTemplate Action](#clustergetcomponenttemplate-action)
* [Cluster.Health Action](#clusterhealth-action-1)
* [Cluster.PostVotingConfigExclusions Action](#clusterpostvotingconfigexclusions-action-1)
* [Cluster.Reroute Action](#clusterreroute-action-1)
* [Cluster.Stats Action](#clusterstats-action)
* [Indices.GetComposableTemplate Action](#indicesgetcomposabletemplate-action)
* [Nodes.HotThreads Action](#nodeshotthreads-action-1)
Expand All @@ -48,6 +62,23 @@
- The `MasterTimeout` parameters on all actions have been marked `[Obsolete]`, please migrate to using `ClusterManagerTimeout` if your OpenSearch cluster is at least version `2.0.0` as `MasterTimeout` may be removed in future major versions.
- The `ExpandWildcards` enum is now attributed with `[Flags]` to allow combining of multiple values e.g. `ExpandWildcards.Open | ExpandWildcards.Closed` to match open and closed indexes but not hidden.
- The `Bytes` enum has been renamed to `ByteUnit`.
- All instances of the `Routing` parameter now accept an array of strings instead of a single string to better represent the underlying API that accepts comma-separated lists.

#### Bulk Action
- The `TypeQueryString` parameter has been renamed to simply `Type`.

#### DeleteByQuery Action
- The `Slices` parameter now accepts a `string` instead of a `long` as the API can also accept the string `"auto"`.

#### ReindexOnServer Action
- The `Slices` parameter now accepts a `string` instead of a `long` as the API can also accept the string `"auto"`.

#### Search Action
- The `MinCompatibleShardNode` parameter has been removed as it was never supported by OpenSearch.

#### UpdateByQuery Action
- The `Slices` parameter now accepts a `string` instead of a `long` as the API can also accept the string `"auto"`.
- The `VersionType` parameter has been removed as it was never supported by OpenSearch.

#### Cat.Help Action
- The `Help` and `SortByColumns` parameters have been removed as they are unsupported by OpenSearch.
Expand All @@ -62,7 +93,7 @@
- The `IncludeBootstrap` parameter has been removed as it was never supported by OpenSearch.

#### Cat.Recovery Action
- The `IndexQueryString` parameter has been renamed to simply `Index`
- The `IndexQueryString` parameter has been renamed to simply `Index`.

#### Cluster.ExistsComponentTemplate Action
- This action has been removed in favour of the correctly named `Cluster.ComponentTemplateExists` action.
Expand All @@ -74,17 +105,20 @@
#### Cluster.PostVotingConfigExclusions Action
- The `NodeIds` & `NodeNames` parameters now accept an array of strings instead of a single string to better represent the underlying API that accepts comma-separated lists.

#### Cluster.Reroute Action
- The `Metric` parameter has been changed from a `string` to an `ClusterRerouteMetric` enum.

#### Features Namespace
- The entire `Features` API namespace has been removed, there is no migration path as it was never supported by OpenSearch.

#### Indices.AddBlock Action
- The `block` parameter has been changed from a `string` to an `IndexApiBlock` enum.

#### Indices.Analyze Action
- The `IndexQueryString` parameter has been renamed to simply `Index`
- The `IndexQueryString` parameter has been renamed to simply `Index`.

#### Indices.ClearCache Action
- The `IndexQueryString` parameter has been renamed to simply `Index`
- The `IndexQueryString` parameter has been renamed to simply `Index`.

#### Indices.DeleteTemplateV2 Action
- This action has been removed in favour of the more descriptively named and typed `Indices.DeleteComposableTemplate` action.
Expand All @@ -101,7 +135,10 @@
- This action has been removed in favour of the more descriptively named and typed `Indices.PutComposableTemplate` action.

#### Indices.ShardStores Action
- The `Status` parameter now takes an `IndicesShardStoresShardStoreStatus` flag enum instead of a `string` array.
- The `Status` parameter now takes an `IndicesShardStoresStatus` flag enum instead of a `string` array.

#### Indices.Stats Action
- The `metric` parameter has been changed from a `string` to an `IndicesStatsMetric` enum.

#### Nodes.HotThreads Action
- The `ThreadType` parameter has been renamed to just `Type` to match the query parameter it represents. Its corresponding `ThreadType` enum has been renamed to `NodesSampleType`.
Expand All @@ -123,6 +160,12 @@
- The namespaced APIs exposed in `IOpenSearchClient` have each gained a corresponding interface and the types of the properties on `IOpenSearchClient` and `OpenSearchClient` have been changed from the concrete implementations to the matching interfaces. For example, `IOpenSearchClient.Cluster` was `ClusterNamespace` and now is `IClusterNamespace`.
- The `Bytes` enum has been renamed to `ByteUnit`.

#### Bulk Action
- The `TypeQueryString` parameter has been renamed to simply `Type`.

#### UpdateByQuery Action
- The `VersionType` parameter has been removed as it was never supported by OpenSearch.

#### Cat.Help Action
- The `Help` and `SortByColumns` parameters have been removed as they are unsupported by OpenSearch.

Expand All @@ -146,6 +189,9 @@
#### Cluster.PostVotingConfigExclusions Action
- The `NodeIds` & `NodeNames` parameters now accept an array of strings instead of a single string to better represent the underlying API that accepts comma-separated lists.

#### Cluster.Reroute Action
- The `Metric` parameter has been changed from a `string` to an `ClusterRerouteMetric` enum.

#### Cluster.Stats Action
- The `Nodes.OperatingSystem.PrettyNames` property in the response object's item type has been renamed from `ClusterOperatingSystemPrettyNane` to `ClusterOperatingSystemPrettyName` to correct a spelling mistake.

Expand Down
5 changes: 1 addition & 4 deletions src/ApiGenerator/Configuration/CodeConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public static class CodeConfiguration
{
private static readonly Glob[] OperationsToInclude =
[
new("{create,delete}_pit"),
new("{delete,get}_all_pits"),

new("cat.*"),
new("cluster.*"),
new("dangling_indices.*"),
Expand All @@ -52,7 +49,7 @@ public static class CodeConfiguration
new("tasks.*")
];

public static bool IncludeOperation(string name) => OperationsToInclude.Any(g => g.IsMatch(name));
public static bool IncludeOperation(string name) => !name.Contains('.') || OperationsToInclude.Any(g => g.IsMatch(name));

/// <summary>
/// Map API default names for API's we are only supporting on the low level client first
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ namespace ApiGenerator.Configuration.Overrides.Endpoints
{
public class DeleteByQueryOverrides : EndpointOverridesBase
{
public override IEnumerable<string> SkipQueryStringParams => new[] { "max_docs", };
public override IEnumerable<string> SkipQueryStringParams => ["max_docs", "slices"];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ namespace ApiGenerator.Configuration.Overrides.Endpoints
{
public class ReindexOnServerOverrides : EndpointOverridesBase
{
public override IEnumerable<string> SkipQueryStringParams => new[] { "max_docs", };
public override IEnumerable<string> SkipQueryStringParams => ["max_docs", "slices"];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ namespace ApiGenerator.Configuration.Overrides.Endpoints
// ReSharper disable once UnusedMember.Global
public class SearchOverrides : EndpointOverridesBase
{
public override IEnumerable<string> SkipQueryStringParams => new[]
{
public override IEnumerable<string> SkipQueryStringParams =>
[
"size",
"from",
"timeout",
Expand All @@ -45,12 +45,8 @@ public class SearchOverrides : EndpointOverridesBase
"_source_includes",
"_source_excludes",
"track_scores",
"terminate_after",
};

public override IEnumerable<string> RenderPartial => new[]
{
"track_total_hits"
};
"track_total_hits",
"terminate_after"
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ namespace ApiGenerator.Configuration.Overrides.Endpoints
{
public class UpdateByQueryOverrides : EndpointOverridesBase
{
public override IEnumerable<string> SkipQueryStringParams => new[] { "max_docs", };
public override IEnumerable<string> SkipQueryStringParams => ["max_docs", "slices"];
}
}
2 changes: 1 addition & 1 deletion src/ApiGenerator/Domain/Code/HttpMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class HttpMethod
public static readonly HttpMethod Patch = new("Patch", true);
public static readonly HttpMethod Post = new("Post", true);
public static readonly HttpMethod Put = new("Put", true);
public static readonly HttpMethod[] All = { Delete, Get, Head, Patch, Post, Put };
public static readonly HttpMethod[] All = [Delete, Get, Head, Patch, Post, Put];

private readonly string _method;

Expand Down
Loading
Loading