/* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/
/*
* Modifications Copyright OpenSearch Contributors. See
* GitHub history for details.
*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
// -----------------------------------------------
//
// This file is automatically generated
// Please do not edit these files manually
// Run the following in the root of the repos:
//
// *NIX : ./build.sh codegen
// Windows : build.bat codegen
//
// -----------------------------------------------
// ReSharper disable RedundantUsingDirective
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using OpenSearch.Net;
using static OpenSearch.Net.HttpMethod;
// ReSharper disable InterpolatedStringExpressionIsNotIFormattable
// ReSharper disable once CheckNamespace
// ReSharper disable InterpolatedStringExpressionIsNotIFormattable
// ReSharper disable RedundantExtendsListEntry
namespace OpenSearch.Net.Specification.SnapshotApi
{
///
/// Snapshot APIs.
/// Not intended to be instantiated directly. Use the property
/// on .
///
///
public partial class LowLevelSnapshotNamespace : NamespacedClientProxy
{
internal LowLevelSnapshotNamespace(OpenSearchLowLevelClient client): base(client)
{
}
///POST on /_snapshot/{repository}/_cleanup
///A repository name
///
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse CleanupRepository(string repository, PostData body, CleanupRepositoryRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(POST, Url($"_snapshot/{repository:repository}/_cleanup"), body, RequestParams(requestParameters));
///POST on /_snapshot/{repository}/_cleanup
///A repository name
///
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.cleanup_repository", "repository, body")]
public Task CleanupRepositoryAsync(string repository, PostData body, CleanupRepositoryRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(POST, Url($"_snapshot/{repository:repository}/_cleanup"), ctx, body, RequestParams(requestParameters));
///PUT on /_snapshot/{repository}/{snapshot}/_clone/{target_snapshot} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///The name of the snapshot to clone from
///The name of the cloned snapshot to create
///The snapshot clone definition
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse Clone(string repository, string snapshot, string targetSnapshot, PostData body, CloneSnapshotRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(PUT, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}/_clone/{targetSnapshot:targetSnapshot}"), body, RequestParams(requestParameters));
///PUT on /_snapshot/{repository}/{snapshot}/_clone/{target_snapshot} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///The name of the snapshot to clone from
///The name of the cloned snapshot to create
///The snapshot clone definition
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.clone", "repository, snapshot, target_snapshot, body")]
public Task CloneAsync(string repository, string snapshot, string targetSnapshot, PostData body, CloneSnapshotRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(PUT, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}/_clone/{targetSnapshot:targetSnapshot}"), ctx, body, RequestParams(requestParameters));
///PUT on /_snapshot/{repository}/{snapshot} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///A snapshot name
///The snapshot definition
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse Snapshot(string repository, string snapshot, PostData body, SnapshotRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(PUT, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}"), body, RequestParams(requestParameters));
///PUT on /_snapshot/{repository}/{snapshot} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///A snapshot name
///The snapshot definition
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.create", "repository, snapshot, body")]
public Task SnapshotAsync(string repository, string snapshot, PostData body, SnapshotRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(PUT, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}"), ctx, body, RequestParams(requestParameters));
///PUT on /_snapshot/{repository} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///The repository definition
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse CreateRepository(string repository, PostData body, CreateRepositoryRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(PUT, Url($"_snapshot/{repository:repository}"), body, RequestParams(requestParameters));
///PUT on /_snapshot/{repository} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///The repository definition
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.create_repository", "repository, body")]
public Task CreateRepositoryAsync(string repository, PostData body, CreateRepositoryRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(PUT, Url($"_snapshot/{repository:repository}"), ctx, body, RequestParams(requestParameters));
///DELETE on /_snapshot/{repository}/{snapshot} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///A snapshot name
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse Delete(string repository, string snapshot, DeleteSnapshotRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(DELETE, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}"), null, RequestParams(requestParameters));
///DELETE on /_snapshot/{repository}/{snapshot} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///A snapshot name
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.delete", "repository, snapshot")]
public Task DeleteAsync(string repository, string snapshot, DeleteSnapshotRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(DELETE, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}"), ctx, null, RequestParams(requestParameters));
///DELETE on /_snapshot/{repository} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported.
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse DeleteRepository(string repository, DeleteRepositoryRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(DELETE, Url($"_snapshot/{repository:repository}"), null, RequestParams(requestParameters));
///DELETE on /_snapshot/{repository} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///Name of the snapshot repository to unregister. Wildcard (`*`) patterns are supported.
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.delete_repository", "repository")]
public Task DeleteRepositoryAsync(string repository, DeleteRepositoryRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(DELETE, Url($"_snapshot/{repository:repository}"), ctx, null, RequestParams(requestParameters));
///GET on /_snapshot/{repository}/{snapshot} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///A comma-separated list of snapshot names
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse Get(string repository, string snapshot, GetSnapshotRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}"), null, RequestParams(requestParameters));
///GET on /_snapshot/{repository}/{snapshot} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///A comma-separated list of snapshot names
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.get", "repository, snapshot")]
public Task GetAsync(string repository, string snapshot, GetSnapshotRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}"), ctx, null, RequestParams(requestParameters));
///GET on /_snapshot https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse GetRepository(GetRepositoryRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, "_snapshot", null, RequestParams(requestParameters));
///GET on /_snapshot https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.get_repository", "")]
public Task GetRepositoryAsync(GetRepositoryRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, "_snapshot", ctx, null, RequestParams(requestParameters));
///GET on /_snapshot/{repository} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A comma-separated list of repository names
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse GetRepository(string repository, GetRepositoryRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, Url($"_snapshot/{repository:repository}"), null, RequestParams(requestParameters));
///GET on /_snapshot/{repository} https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A comma-separated list of repository names
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.get_repository", "repository")]
public Task GetRepositoryAsync(string repository, GetRepositoryRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, Url($"_snapshot/{repository:repository}"), ctx, null, RequestParams(requestParameters));
///POST on /_snapshot/{repository}/{snapshot}/_restore https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///A snapshot name
///Details of what to restore
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse Restore(string repository, string snapshot, PostData body, RestoreRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(POST, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}/_restore"), body, RequestParams(requestParameters));
///POST on /_snapshot/{repository}/{snapshot}/_restore https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///A snapshot name
///Details of what to restore
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.restore", "repository, snapshot, body")]
public Task RestoreAsync(string repository, string snapshot, PostData body, RestoreRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(POST, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}/_restore"), ctx, body, RequestParams(requestParameters));
///GET on /_snapshot/_status https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse Status(SnapshotStatusRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, "_snapshot/_status", null, RequestParams(requestParameters));
///GET on /_snapshot/_status https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.status", "")]
public Task StatusAsync(SnapshotStatusRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, "_snapshot/_status", ctx, null, RequestParams(requestParameters));
///GET on /_snapshot/{repository}/_status https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse Status(string repository, SnapshotStatusRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, Url($"_snapshot/{repository:repository}/_status"), null, RequestParams(requestParameters));
///GET on /_snapshot/{repository}/_status https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.status", "repository")]
public Task StatusAsync(string repository, SnapshotStatusRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, Url($"_snapshot/{repository:repository}/_status"), ctx, null, RequestParams(requestParameters));
///GET on /_snapshot/{repository}/{snapshot}/_status https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///A comma-separated list of snapshot names
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse Status(string repository, string snapshot, SnapshotStatusRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(GET, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}/_status"), null, RequestParams(requestParameters));
///GET on /_snapshot/{repository}/{snapshot}/_status https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///A comma-separated list of snapshot names
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.status", "repository, snapshot")]
public Task StatusAsync(string repository, string snapshot, SnapshotStatusRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(GET, Url($"_snapshot/{repository:repository}/{snapshot:snapshot}/_status"), ctx, null, RequestParams(requestParameters));
///POST on /_snapshot/{repository}/_verify https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///Request specific configuration such as querystring parameters & request specific connection settings.
public TResponse VerifyRepository(string repository, VerifyRepositoryRequestParameters requestParameters = null)
where TResponse : class, IOpenSearchResponse, new() => DoRequest(POST, Url($"_snapshot/{repository:repository}/_verify"), null, RequestParams(requestParameters));
///POST on /_snapshot/{repository}/_verify https://opensearch.org/docs/latest/opensearch/rest-api/cat/cat-snapshots/
///A repository name
///Request specific configuration such as querystring parameters & request specific connection settings.
[MapsApi("snapshot.verify_repository", "repository")]
public Task VerifyRepositoryAsync(string repository, VerifyRepositoryRequestParameters requestParameters = null, CancellationToken ctx = default)
where TResponse : class, IOpenSearchResponse, new() => DoRequestAsync(POST, Url($"_snapshot/{repository:repository}/_verify"), ctx, null, RequestParams(requestParameters));
}
}