Skip to content

Commit

Permalink
Remove Migration Assistance and Upgrade APIs (#3839)
Browse files Browse the repository at this point in the history
  • Loading branch information
russcam authored and Mpdreamz committed Jun 20, 2019
1 parent 5d84d79 commit 1528923
Show file tree
Hide file tree
Showing 20 changed files with 398 additions and 982 deletions.
4 changes: 4 additions & 0 deletions src/CodeGeneration/ApiGenerator/ApiGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@
<PackageReference Include="RazorLight.Unofficial" Version="2.0.0-beta1.3" />
<!--<PackageReference Include="RazorLight" Version="2.0.0-beta1" />-->
</ItemGroup>
<ItemGroup>
<Folder Include="RestSpecification\Core" />
<Folder Include="RestSpecification\XPack" />
</ItemGroup>
</Project>
388 changes: 195 additions & 193 deletions src/CodeGeneration/ApiGenerator/RestSpecification/Core/root.html

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

394 changes: 198 additions & 196 deletions src/CodeGeneration/ApiGenerator/RestSpecification/XPack/root.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.0
v7.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -29,45 +29,4 @@ public class DeprecationInfoRequestParameters : RequestParameters<DeprecationInf
{
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
}

///<summary>Request options for Assistance <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html</para></summary>
public class MigrationAssistanceRequestParameters : RequestParameters<MigrationAssistanceRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.GET;
///<summary>
/// Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have
/// been specified)
///</summary>
public bool? AllowNoIndices
{
get => Q<bool? >("allow_no_indices");
set => Q("allow_no_indices", value);
}

///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
public ExpandWildcards? ExpandWildcards
{
get => Q<ExpandWildcards? >("expand_wildcards");
set => Q("expand_wildcards", value);
}

///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
public bool? IgnoreUnavailable
{
get => Q<bool? >("ignore_unavailable");
set => Q("ignore_unavailable", value);
}
}

///<summary>Request options for Upgrade <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html</para></summary>
public class MigrationUpgradeRequestParameters : RequestParameters<MigrationUpgradeRequestParameters>
{
public override HttpMethod DefaultHttpMethod => HttpMethod.POST;
///<summary>Should the request block until the upgrade operation is completed</summary>
public bool? WaitForCompletion
{
get => Q<bool? >("wait_for_completion");
set => Q("wait_for_completion", value);
}
}
}
28 changes: 0 additions & 28 deletions src/Elasticsearch.Net/ElasticLowLevelClient.Migration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,33 +61,5 @@ public TResponse DeprecationInfo<TResponse>(string index, DeprecationInfoRequest
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public Task<TResponse> DeprecationInfoAsync<TResponse>(string index, DeprecationInfoRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"{index:index}/_migration/deprecations"), ctx, null, RequestParams(requestParameters));
///<summary>GET on /_migration/assistance <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse Assistance<TResponse>(MigrationAssistanceRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, "_migration/assistance", null, RequestParams(requestParameters));
///<summary>GET on /_migration/assistance <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html</para></summary>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public Task<TResponse> AssistanceAsync<TResponse>(MigrationAssistanceRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, "_migration/assistance", ctx, null, RequestParams(requestParameters));
///<summary>GET on /_migration/assistance/{index} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html</para></summary>
///<param name = "index">A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse Assistance<TResponse>(string index, MigrationAssistanceRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(GET, Url($"_migration/assistance/{index:index}"), null, RequestParams(requestParameters));
///<summary>GET on /_migration/assistance/{index} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html</para></summary>
///<param name = "index">A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public Task<TResponse> AssistanceAsync<TResponse>(string index, MigrationAssistanceRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(GET, Url($"_migration/assistance/{index:index}"), ctx, null, RequestParams(requestParameters));
///<summary>POST on /_migration/upgrade/{index} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html</para></summary>
///<param name = "index">The name of the index</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public TResponse Upgrade<TResponse>(string index, MigrationUpgradeRequestParameters requestParameters = null)
where TResponse : class, IElasticsearchResponse, new() => DoRequest<TResponse>(POST, Url($"_migration/upgrade/{index:index}"), null, RequestParams(requestParameters));
///<summary>POST on /_migration/upgrade/{index} <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html</para></summary>
///<param name = "index">The name of the index</param>
///<param name = "requestParameters">Request specific configuration such as querystring parameters &amp; request specific connection settings.</param>
public Task<TResponse> UpgradeAsync<TResponse>(string index, MigrationUpgradeRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IElasticsearchResponse, new() => DoRequestAsync<TResponse>(POST, Url($"_migration/upgrade/{index:index}"), ctx, null, RequestParams(requestParameters));
}
}
61 changes: 0 additions & 61 deletions src/Nest/Descriptors.Migration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,65 +54,4 @@ public DeprecationInfoDescriptor Index<TOther>()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (IndexName)v));
// Request parameters
}

///<summary>descriptor for Assistance <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html</para></summary>
public partial class MigrationAssistanceDescriptor : RequestDescriptorBase<MigrationAssistanceDescriptor, MigrationAssistanceRequestParameters, IMigrationAssistanceRequest>, IMigrationAssistanceRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.MigrationAssistance;
///<summary>/_migration/assistance</summary>
public MigrationAssistanceDescriptor(): base()
{
}

///<summary>/_migration/assistance/{index}</summary>
///<param name = "index">Optional, accepts null</param>
public MigrationAssistanceDescriptor(Indices index): base(r => r.Optional("index", index))
{
}

// values part of the url path
Indices IMigrationAssistanceRequest.Index => Self.RouteValues.Get<Indices>("index");
///<summary>A comma-separated list of index names; use the special string `_all` or Indices.All to perform the operation on all indices</summary>
public MigrationAssistanceDescriptor Index(Indices index) => Assign(index, (a, v) => a.RouteValues.Optional("index", v));
///<summary>a shortcut into calling Index(typeof(TOther))</summary>
public MigrationAssistanceDescriptor Index<TOther>()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Optional("index", (Indices)v));
///<summary>A shortcut into calling Index(Indices.All)</summary>
public MigrationAssistanceDescriptor AllIndices() => Index(Indices.All);
// Request parameters
///<summary>Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes `_all` string or when no indices have been specified)</summary>
public MigrationAssistanceDescriptor AllowNoIndices(bool? allownoindices = true) => Qs("allow_no_indices", allownoindices);
///<summary>Whether to expand wildcard expression to concrete indices that are open, closed or both.</summary>
public MigrationAssistanceDescriptor ExpandWildcards(ExpandWildcards? expandwildcards) => Qs("expand_wildcards", expandwildcards);
///<summary>Whether specified concrete indices should be ignored when unavailable (missing or closed)</summary>
public MigrationAssistanceDescriptor IgnoreUnavailable(bool? ignoreunavailable = true) => Qs("ignore_unavailable", ignoreunavailable);
}

///<summary>descriptor for Upgrade <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html</para></summary>
public partial class MigrationUpgradeDescriptor : RequestDescriptorBase<MigrationUpgradeDescriptor, MigrationUpgradeRequestParameters, IMigrationUpgradeRequest>, IMigrationUpgradeRequest
{
internal override ApiUrls ApiUrls => ApiUrlsLookups.MigrationUpgrade;
///<summary>/_migration/upgrade/{index}</summary>
///<param name = "index">this parameter is required</param>
public MigrationUpgradeDescriptor(IndexName index): base(r => r.Required("index", index))
{
}

///<summary>Used for serialization purposes, making sure we have a parameterless constructor</summary>
[SerializationConstructor]
protected MigrationUpgradeDescriptor(): base()
{
}

// values part of the url path
IndexName IMigrationUpgradeRequest.Index => Self.RouteValues.Get<IndexName>("index");
///<summary>The name of the index</summary>
public MigrationUpgradeDescriptor Index(IndexName index) => Assign(index, (a, v) => a.RouteValues.Required("index", v));
///<summary>a shortcut into calling Index(typeof(TOther))</summary>
public MigrationUpgradeDescriptor Index<TOther>()
where TOther : class => Assign(typeof(TOther), (a, v) => a.RouteValues.Required("index", (IndexName)v));
// Request parameters
///<summary>Should the request block until the upgrade operation is completed</summary>
public MigrationUpgradeDescriptor WaitForCompletion(bool? waitforcompletion = true) => Qs("wait_for_completion", waitforcompletion);
}
}
48 changes: 0 additions & 48 deletions src/Nest/ElasticClient.Migration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,53 +60,5 @@ internal MigrationNamespace(ElasticClient client): base(client)
/// <a href = "http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html">http://www.elastic.co/guide/en/migration/current/migration-api-deprecation.html</a>
/// </summary>
public Task<DeprecationInfoResponse> DeprecationInfoAsync(IDeprecationInfoRequest request, CancellationToken ct = default) => DoRequestAsync<IDeprecationInfoRequest, DeprecationInfoResponse>(request, request.RequestParameters, ct);
/// <summary>
/// <c>GET</c> request to the <c>migration.get_assistance</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html</a>
/// </summary>
public MigrationAssistanceResponse Assistance(Indices index = null, Func<MigrationAssistanceDescriptor, IMigrationAssistanceRequest> selector = null) => Assistance(selector.InvokeOrDefault(new MigrationAssistanceDescriptor().Index(index: index)));
/// <summary>
/// <c>GET</c> request to the <c>migration.get_assistance</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html</a>
/// </summary>
public Task<MigrationAssistanceResponse> AssistanceAsync(Indices index = null, Func<MigrationAssistanceDescriptor, IMigrationAssistanceRequest> selector = null, CancellationToken ct = default) => AssistanceAsync(selector.InvokeOrDefault(new MigrationAssistanceDescriptor().Index(index: index)), ct);
/// <summary>
/// <c>GET</c> request to the <c>migration.get_assistance</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html</a>
/// </summary>
public MigrationAssistanceResponse Assistance(IMigrationAssistanceRequest request) => DoRequest<IMigrationAssistanceRequest, MigrationAssistanceResponse>(request, request.RequestParameters);
/// <summary>
/// <c>GET</c> request to the <c>migration.get_assistance</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-assistance.html</a>
/// </summary>
public Task<MigrationAssistanceResponse> AssistanceAsync(IMigrationAssistanceRequest request, CancellationToken ct = default) => DoRequestAsync<IMigrationAssistanceRequest, MigrationAssistanceResponse>(request, request.RequestParameters, ct);
/// <summary>
/// <c>POST</c> request to the <c>migration.upgrade</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html</a>
/// </summary>
public MigrationUpgradeResponse Upgrade(IndexName index, Func<MigrationUpgradeDescriptor, IMigrationUpgradeRequest> selector = null) => Upgrade(selector.InvokeOrDefault(new MigrationUpgradeDescriptor(index: index)));
/// <summary>
/// <c>POST</c> request to the <c>migration.upgrade</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html</a>
/// </summary>
public Task<MigrationUpgradeResponse> UpgradeAsync(IndexName index, Func<MigrationUpgradeDescriptor, IMigrationUpgradeRequest> selector = null, CancellationToken ct = default) => UpgradeAsync(selector.InvokeOrDefault(new MigrationUpgradeDescriptor(index: index)), ct);
/// <summary>
/// <c>POST</c> request to the <c>migration.upgrade</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html</a>
/// </summary>
public MigrationUpgradeResponse Upgrade(IMigrationUpgradeRequest request) => DoRequest<IMigrationUpgradeRequest, MigrationUpgradeResponse>(request, request.RequestParameters);
/// <summary>
/// <c>POST</c> request to the <c>migration.upgrade</c> API, read more about this API online:
/// <para></para>
/// <a href = "https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html">https://www.elastic.co/guide/en/elasticsearch/reference/current/migration-api-upgrade.html</a>
/// </summary>
public Task<MigrationUpgradeResponse> UpgradeAsync(IMigrationUpgradeRequest request, CancellationToken ct = default) => DoRequestAsync<IMigrationUpgradeRequest, MigrationUpgradeResponse>(request, request.RequestParameters, ct);
}
}
Loading

0 comments on commit 1528923

Please sign in to comment.