/* * InfluxDB OSS API Service * * The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint. * * OpenAPI spec version: 2.0.0 * * Generated by: https://github.com/openapitools/openapi-generator.git */ using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Threading; using RestSharp; using InfluxDB.Client.Api.Client; using InfluxDB.Client.Api.Domain; namespace InfluxDB.Client.Api.Service { /// /// Represents a collection of functions to interact with the API endpoints /// public interface IRestoreService : IApiAccessor { #region Synchronous Operations /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// /// /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// byte[] byte[] PostRestoreBucketID(string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null); /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// /// /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// ApiResponse of byte[] ApiResponse PostRestoreBucketIDWithHttpInfo(string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null); /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// /// /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// RestoredBucketMappings RestoredBucketMappings PostRestoreBucketMetadata(BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null); /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// /// /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// ApiResponse of RestoredBucketMappings ApiResponse PostRestoreBucketMetadataWithHttpInfo( BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null); /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// /// /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// PostRestoreKVResponse PostRestoreKVResponse PostRestoreKV(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null); /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// /// /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of PostRestoreKVResponse ApiResponse PostRestoreKVWithHttpInfo(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null); /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// /// /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// void PostRestoreSQL(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null); /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// /// /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of Object(void) ApiResponse PostRestoreSQLWithHttpInfo(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null); /// /// Restore a TSM snapshot into a shard. /// /// /// /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// void PostRestoreShardId(string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null); /// /// Restore a TSM snapshot into a shard. /// /// /// /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of Object(void) ApiResponse PostRestoreShardIdWithHttpInfo(string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null); #endregion Synchronous Operations #region Asynchronous Operations /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// /// /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of byte[] System.Threading.Tasks.Task PostRestoreBucketIDAsync(string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null, CancellationToken cancellationToken = default); /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// /// /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of ApiResponse (byte[]) System.Threading.Tasks.Task> PostRestoreBucketIDAsyncWithHttpInfo(string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null, CancellationToken cancellationToken = default); /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// /// /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestoredBucketMappings System.Threading.Tasks.Task PostRestoreBucketMetadataAsync( BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// /// /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (RestoredBucketMappings) System.Threading.Tasks.Task> PostRestoreBucketMetadataAsyncWithHttpInfo( BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null, CancellationToken cancellationToken = default); /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// /// /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of PostRestoreKVResponse System.Threading.Tasks.Task PostRestoreKVAsync(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default); /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// /// /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of ApiResponse (PostRestoreKVResponse) System.Threading.Tasks.Task> PostRestoreKVAsyncWithHttpInfo( System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default); /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// /// /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of void System.Threading.Tasks.Task PostRestoreSQLAsync(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default); /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// /// /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> PostRestoreSQLAsyncWithHttpInfo(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default); /// /// Restore a TSM snapshot into a shard. /// /// /// /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of void System.Threading.Tasks.Task PostRestoreShardIdAsync(string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default); /// /// Restore a TSM snapshot into a shard. /// /// /// /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of ApiResponse System.Threading.Tasks.Task> PostRestoreShardIdAsyncWithHttpInfo(string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default); #endregion Asynchronous Operations } /// /// Represents a collection of functions to interact with the API endpoints /// public partial class RestoreService : IRestoreService { private ExceptionFactory _exceptionFactory = (name, response) => null; /// /// Initializes a new instance of the class. /// /// public RestoreService(string basePath) { Configuration = new Configuration { BasePath = basePath }; ExceptionFactory = Configuration.DefaultExceptionFactory; } /// /// Initializes a new instance of the class /// using Configuration object /// /// An instance of Configuration /// public RestoreService(Configuration configuration = null) { if (configuration == null) // use the default one in Configuration { Configuration = Configuration.Default; } else { Configuration = configuration; } ExceptionFactory = Configuration.DefaultExceptionFactory; } /// /// Gets the base path of the API client. /// /// The base path public string GetBasePath() { return Configuration.ApiClient.RestClientOptions.BaseUrl.ToString(); } /// /// Sets the base path of the API client. /// /// The base path [Obsolete( "SetBasePath is deprecated, please do 'Configuration.ApiClient = new ApiClient(\"http://new-path\")' instead.")] public void SetBasePath(string basePath) { // do nothing } /// /// Gets or sets the configuration object /// /// An instance of the Configuration public Configuration Configuration { get; set; } /// /// Provides a factory method hook for the creation of exceptions. /// public ExceptionFactory ExceptionFactory { get { if (_exceptionFactory != null && _exceptionFactory.GetInvocationList().Length > 1) { throw new InvalidOperationException("Multicast delegate for ExceptionFactory is unsupported."); } return _exceptionFactory; } set => _exceptionFactory = value; } /// /// Gets the default header. /// /// Dictionary of HTTP header [Obsolete("DefaultHeader is deprecated, please use Configuration.DefaultHeader instead.")] public IDictionary DefaultHeader() { return new ReadOnlyDictionary(Configuration.DefaultHeader); } /// /// Add default header. /// /// Header field name. /// Header field value. /// [Obsolete("AddDefaultHeader is deprecated, please use Configuration.AddDefaultHeader instead.")] public void AddDefaultHeader(string key, string value) { Configuration.AddDefaultHeader(key, value); } /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// byte[] public byte[] PostRestoreBucketID(string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null) { var localVarResponse = PostRestoreBucketIDWithHttpInfo(bucketID, body, zapTraceSpan, contentType); return localVarResponse.Data; } /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// ApiResponse of byte[] public ApiResponse PostRestoreBucketIDWithHttpInfo(string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null) { // verify the required parameter 'bucketID' is set if (bucketID == null) { throw new ApiException(400, "Missing required parameter 'bucketID' when calling RestoreService->PostRestoreBucketID"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreBucketID"); } var localVarPath = "/api/v2/restore/bucket/{bucketID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (bucketID != null) { localVarPathParams.Add("bucketID", Configuration.ApiClient.ParameterToString(bucketID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreBucketID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (byte[])Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); } /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// Cancellation token /// ApiResponse of byte[] public async System.Threading.Tasks.Task PostRestoreBucketIDWithIRestResponseAsync( string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null, CancellationToken cancellationToken = default) { // verify the required parameter 'bucketID' is set if (bucketID == null) { throw new ApiException(400, "Missing required parameter 'bucketID' when calling RestoreService->PostRestoreBucketID"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreBucketID"); } var localVarPath = "/api/v2/restore/bucket/{bucketID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (bucketID != null) { localVarPathParams.Add("bucketID", Configuration.ApiClient.ParameterToString(bucketID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreBucketID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// ApiResponse of byte[] public RestResponse PostRestoreBucketIDWithIRestResponse(string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null) { // verify the required parameter 'bucketID' is set if (bucketID == null) { throw new ApiException(400, "Missing required parameter 'bucketID' when calling RestoreService->PostRestoreBucketID"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreBucketID"); } var localVarPath = "/api/v2/restore/bucket/{bucketID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (bucketID != null) { localVarPathParams.Add("bucketID", Configuration.ApiClient.ParameterToString(bucketID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreBucketID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// ApiResponse of byte[] public RestRequest PostRestoreBucketIDWithRestRequest(string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null) { // verify the required parameter 'bucketID' is set if (bucketID == null) { throw new ApiException(400, "Missing required parameter 'bucketID' when calling RestoreService->PostRestoreBucketID"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreBucketID"); } var localVarPath = "/api/v2/restore/bucket/{bucketID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (bucketID != null) { localVarPathParams.Add("bucketID", Configuration.ApiClient.ParameterToString(bucketID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of byte[] public async System.Threading.Tasks.Task PostRestoreBucketIDAsync(string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null, CancellationToken cancellationToken = default) { var localVarResponse = await PostRestoreBucketIDAsyncWithHttpInfo(bucketID, body, zapTraceSpan, contentType, cancellationToken) .ConfigureAwait(false); return localVarResponse.Data; } /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of ApiResponse (byte[]) public async System.Threading.Tasks.Task> PostRestoreBucketIDAsyncWithHttpInfo( string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostRestoreBucketIDAsyncWithIRestResponse(bucketID, body, zapTraceSpan, contentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreBucketID", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (byte[])Configuration.ApiClient.Deserialize(localVarResponse, typeof(byte[]))); } /// /// Overwrite storage metadata for a bucket with shard info from a backup. /// /// Thrown when fails to make API call /// The bucket ID. /// Database info serialized as protobuf. /// OpenTracing span context (optional) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of RestResponse (byte[]) public async System.Threading.Tasks.Task PostRestoreBucketIDAsyncWithIRestResponse( string bucketID, byte[] body, string zapTraceSpan = null, string contentType = null, CancellationToken cancellationToken = default) { // verify the required parameter 'bucketID' is set if (bucketID == null) { throw new ApiException(400, "Missing required parameter 'bucketID' when calling RestoreService->PostRestoreBucketID"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreBucketID"); } var localVarPath = "/api/v2/restore/bucket/{bucketID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (bucketID != null) { localVarPathParams.Add("bucketID", Configuration.ApiClient.ParameterToString(bucketID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreBucketID", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// RestoredBucketMappings public RestoredBucketMappings PostRestoreBucketMetadata(BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null) { var localVarResponse = PostRestoreBucketMetadataWithHttpInfo(bucketMetadataManifest, zapTraceSpan); return localVarResponse.Data; } /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// ApiResponse of RestoredBucketMappings public ApiResponse PostRestoreBucketMetadataWithHttpInfo( BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null) { // verify the required parameter 'bucketMetadataManifest' is set if (bucketMetadataManifest == null) { throw new ApiException(400, "Missing required parameter 'bucketMetadataManifest' when calling RestoreService->PostRestoreBucketMetadata"); } var localVarPath = "/api/v2/restore/bucketMetadata"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (bucketMetadataManifest != null && bucketMetadataManifest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(bucketMetadataManifest); // http body (model) parameter } else { localVarPostBody = bucketMetadataManifest; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreBucketMetadata", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (RestoredBucketMappings)Configuration.ApiClient.Deserialize(localVarResponse, typeof(RestoredBucketMappings))); } /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// Cancellation token /// ApiResponse of RestoredBucketMappings public async System.Threading.Tasks.Task PostRestoreBucketMetadataWithIRestResponseAsync( BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'bucketMetadataManifest' is set if (bucketMetadataManifest == null) { throw new ApiException(400, "Missing required parameter 'bucketMetadataManifest' when calling RestoreService->PostRestoreBucketMetadata"); } var localVarPath = "/api/v2/restore/bucketMetadata"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (bucketMetadataManifest != null && bucketMetadataManifest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(bucketMetadataManifest); // http body (model) parameter } else { localVarPostBody = bucketMetadataManifest; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreBucketMetadata", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// ApiResponse of RestoredBucketMappings public RestResponse PostRestoreBucketMetadataWithIRestResponse(BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null) { // verify the required parameter 'bucketMetadataManifest' is set if (bucketMetadataManifest == null) { throw new ApiException(400, "Missing required parameter 'bucketMetadataManifest' when calling RestoreService->PostRestoreBucketMetadata"); } var localVarPath = "/api/v2/restore/bucketMetadata"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (bucketMetadataManifest != null && bucketMetadataManifest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(bucketMetadataManifest); // http body (model) parameter } else { localVarPostBody = bucketMetadataManifest; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreBucketMetadata", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// ApiResponse of RestoredBucketMappings public RestRequest PostRestoreBucketMetadataWithRestRequest(BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null) { // verify the required parameter 'bucketMetadataManifest' is set if (bucketMetadataManifest == null) { throw new ApiException(400, "Missing required parameter 'bucketMetadataManifest' when calling RestoreService->PostRestoreBucketMetadata"); } var localVarPath = "/api/v2/restore/bucketMetadata"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (bucketMetadataManifest != null && bucketMetadataManifest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(bucketMetadataManifest); // http body (model) parameter } else { localVarPostBody = bucketMetadataManifest; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestoredBucketMappings public async System.Threading.Tasks.Task PostRestoreBucketMetadataAsync( BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { var localVarResponse = await PostRestoreBucketMetadataAsyncWithHttpInfo(bucketMetadataManifest, zapTraceSpan, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// Cancellation token /// Task of ApiResponse (RestoredBucketMappings) public async System.Threading.Tasks.Task> PostRestoreBucketMetadataAsyncWithHttpInfo(BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostRestoreBucketMetadataAsyncWithIRestResponse(bucketMetadataManifest, zapTraceSpan, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreBucketMetadata", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (RestoredBucketMappings)Configuration.ApiClient.Deserialize(localVarResponse, typeof(RestoredBucketMappings))); } /// /// Create a new bucket pre-seeded with shard info from a backup. /// /// Thrown when fails to make API call /// Metadata manifest for a bucket. /// OpenTracing span context (optional) /// Cancellation token /// Task of RestResponse (RestoredBucketMappings) public async System.Threading.Tasks.Task PostRestoreBucketMetadataAsyncWithIRestResponse( BucketMetadataManifest bucketMetadataManifest, string zapTraceSpan = null, CancellationToken cancellationToken = default) { // verify the required parameter 'bucketMetadataManifest' is set if (bucketMetadataManifest == null) { throw new ApiException(400, "Missing required parameter 'bucketMetadataManifest' when calling RestoreService->PostRestoreBucketMetadata"); } var localVarPath = "/api/v2/restore/bucketMetadata"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "application/json" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (bucketMetadataManifest != null && bucketMetadataManifest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(bucketMetadataManifest); // http body (model) parameter } else { localVarPostBody = bucketMetadataManifest; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreBucketMetadata", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// PostRestoreKVResponse public PostRestoreKVResponse PostRestoreKV(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { var localVarResponse = PostRestoreKVWithHttpInfo(body, zapTraceSpan, contentEncoding, contentType); return localVarResponse.Data; } /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of PostRestoreKVResponse public ApiResponse PostRestoreKVWithHttpInfo(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreKV"); } var localVarPath = "/api/v2/restore/kv"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreKV", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (PostRestoreKVResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostRestoreKVResponse))); } /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// ApiResponse of PostRestoreKVResponse public async System.Threading.Tasks.Task PostRestoreKVWithIRestResponseAsync( System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreKV"); } var localVarPath = "/api/v2/restore/kv"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreKV", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of PostRestoreKVResponse public RestResponse PostRestoreKVWithIRestResponse(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreKV"); } var localVarPath = "/api/v2/restore/kv"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreKV", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of PostRestoreKVResponse public RestRequest PostRestoreKVWithRestRequest(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreKV"); } var localVarPath = "/api/v2/restore/kv"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of PostRestoreKVResponse public async System.Threading.Tasks.Task PostRestoreKVAsync(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { var localVarResponse = await PostRestoreKVAsyncWithHttpInfo(body, zapTraceSpan, contentEncoding, contentType, cancellationToken).ConfigureAwait(false); return localVarResponse.Data; } /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of ApiResponse (PostRestoreKVResponse) public async System.Threading.Tasks.Task> PostRestoreKVAsyncWithHttpInfo( System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostRestoreKVAsyncWithIRestResponse(body, zapTraceSpan, contentEncoding, contentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreKV", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), (PostRestoreKVResponse)Configuration.ApiClient.Deserialize(localVarResponse, typeof(PostRestoreKVResponse))); } /// /// Overwrite the embedded KV store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full KV snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of RestResponse (PostRestoreKVResponse) public async System.Threading.Tasks.Task PostRestoreKVAsyncWithIRestResponse( System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreKV"); } var localVarPath = "/api/v2/restore/kv"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreKV", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// public void PostRestoreSQL(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { PostRestoreSQLWithHttpInfo(body, zapTraceSpan, contentEncoding, contentType); } /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of Object(void) public ApiResponse PostRestoreSQLWithHttpInfo(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreSQL"); } var localVarPath = "/api/v2/restore/sql"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreSQL", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task PostRestoreSQLWithIRestResponseAsync( System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreSQL"); } var localVarPath = "/api/v2/restore/sql"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreSQL", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of Object(void) public RestResponse PostRestoreSQLWithIRestResponse(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreSQL"); } var localVarPath = "/api/v2/restore/sql"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreSQL", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of Object(void) public RestRequest PostRestoreSQLWithRestRequest(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreSQL"); } var localVarPath = "/api/v2/restore/sql"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of void public System.Threading.Tasks.Task PostRestoreSQLAsync(System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { return PostRestoreSQLAsyncWithHttpInfo(body, zapTraceSpan, contentEncoding, contentType, cancellationToken); } /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> PostRestoreSQLAsyncWithHttpInfo( System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostRestoreSQLAsyncWithIRestResponse(body, zapTraceSpan, contentEncoding, contentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreSQL", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Overwrite the embedded SQL store on the server with a backed-up snapshot. /// /// Thrown when fails to make API call /// Full SQL snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task PostRestoreSQLAsyncWithIRestResponse( System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreSQL"); } var localVarPath = "/api/v2/restore/sql"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreSQL", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Restore a TSM snapshot into a shard. /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// public void PostRestoreShardId(string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { PostRestoreShardIdWithHttpInfo(shardID, body, zapTraceSpan, contentEncoding, contentType); } /// /// Restore a TSM snapshot into a shard. /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of Object(void) public ApiResponse PostRestoreShardIdWithHttpInfo(string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { // verify the required parameter 'shardID' is set if (shardID == null) { throw new ApiException(400, "Missing required parameter 'shardID' when calling RestoreService->PostRestoreShardId"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreShardId"); } var localVarPath = "/api/v2/restore/shards/{shardID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (shardID != null) { localVarPathParams.Add("shardID", Configuration.ApiClient.ParameterToString(shardID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreShardId", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Restore a TSM snapshot into a shard. /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// ApiResponse of Object(void) public async System.Threading.Tasks.Task PostRestoreShardIdWithIRestResponseAsync(string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { // verify the required parameter 'shardID' is set if (shardID == null) { throw new ApiException(400, "Missing required parameter 'shardID' when calling RestoreService->PostRestoreShardId"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreShardId"); } var localVarPath = "/api/v2/restore/shards/{shardID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (shardID != null) { localVarPathParams.Add("shardID", Configuration.ApiClient.ParameterToString(shardID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreShardId", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Restore a TSM snapshot into a shard. /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of Object(void) public RestResponse PostRestoreShardIdWithIRestResponse(string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { // verify the required parameter 'shardID' is set if (shardID == null) { throw new ApiException(400, "Missing required parameter 'shardID' when calling RestoreService->PostRestoreShardId"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreShardId"); } var localVarPath = "/api/v2/restore/shards/{shardID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (shardID != null) { localVarPathParams.Add("shardID", Configuration.ApiClient.ParameterToString(shardID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)Configuration.ApiClient.CallApi(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreShardId", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } /// /// Restore a TSM snapshot into a shard. /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// ApiResponse of Object(void) public RestRequest PostRestoreShardIdWithRestRequest(string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null) { // verify the required parameter 'shardID' is set if (shardID == null) { throw new ApiException(400, "Missing required parameter 'shardID' when calling RestoreService->PostRestoreShardId"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreShardId"); } var localVarPath = "/api/v2/restore/shards/{shardID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (shardID != null) { localVarPathParams.Add("shardID", Configuration.ApiClient.ParameterToString(shardID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } return Configuration.ApiClient.PrepareRequest(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType); } /// /// Restore a TSM snapshot into a shard. /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of void public System.Threading.Tasks.Task PostRestoreShardIdAsync(string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { return PostRestoreShardIdAsyncWithHttpInfo(shardID, body, zapTraceSpan, contentEncoding, contentType, cancellationToken); } /// /// Restore a TSM snapshot into a shard. /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of ApiResponse public async System.Threading.Tasks.Task> PostRestoreShardIdAsyncWithHttpInfo( string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { // make the HTTP request var localVarResponse = await PostRestoreShardIdAsyncWithIRestResponse(shardID, body, zapTraceSpan, contentEncoding, contentType, cancellationToken).ConfigureAwait(false); var localVarStatusCode = (int)localVarResponse.StatusCode; if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreShardId", localVarResponse); if (exception != null) { throw exception; } } return new ApiResponse(localVarStatusCode, localVarResponse.Headers.Select(h => (h.Name, h.Value)), null); } /// /// Restore a TSM snapshot into a shard. /// /// Thrown when fails to make API call /// The shard ID. /// TSM snapshot. /// OpenTracing span context (optional) /// The value tells InfluxDB what compression is applied to the line protocol in the request payload. To make an API request with a GZIP payload, send `Content-Encoding: gzip` as a request header. (optional, default to identity) /// (optional, default to application/octet-stream) /// Cancellation token /// Task of RestResponse public async System.Threading.Tasks.Task PostRestoreShardIdAsyncWithIRestResponse(string shardID, System.IO.Stream body, string zapTraceSpan = null, string contentEncoding = null, string contentType = null, CancellationToken cancellationToken = default) { // verify the required parameter 'shardID' is set if (shardID == null) { throw new ApiException(400, "Missing required parameter 'shardID' when calling RestoreService->PostRestoreShardId"); } // verify the required parameter 'body' is set if (body == null) { throw new ApiException(400, "Missing required parameter 'body' when calling RestoreService->PostRestoreShardId"); } var localVarPath = "/api/v2/restore/shards/{shardID}"; var localVarPathParams = new Dictionary(); var localVarQueryParams = new List>(); var localVarHeaderParams = new Dictionary(Configuration.DefaultHeader); var localVarFormParams = new Dictionary(); var localVarFileParams = new Dictionary(); object localVarPostBody = null; // to determine the Content-Type header var localVarHttpContentTypes = new string[] { "text/plain" }; var localVarHttpContentType = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes); if (shardID != null) { localVarPathParams.Add("shardID", Configuration.ApiClient.ParameterToString(shardID)); // path parameter } if (zapTraceSpan != null) { localVarHeaderParams.Add("Zap-Trace-Span", Configuration.ApiClient.ParameterToString(zapTraceSpan)); // header parameter } if (contentEncoding != null) { localVarHeaderParams.Add("Content-Encoding", Configuration.ApiClient.ParameterToString(contentEncoding)); // header parameter } if (contentType != null) { localVarHeaderParams.Add("Content-Type", Configuration.ApiClient.ParameterToString(contentType)); // header parameter } if (body != null && body.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(body); // http body (model) parameter } else { localVarPostBody = body; // byte array } // to determine the Accept header var localVarHttpHeaderAccepts = new string[] { "application/json" }; var localVarHttpHeaderAccept = Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts); if (localVarHttpHeaderAccept != null && !localVarHeaderParams.ContainsKey("Accept")) { localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept); } // make the HTTP request var localVarResponse = (RestResponse)await Configuration.ApiClient.CallApiAsync(localVarPath, Method.Post, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams, localVarPathParams, localVarHttpContentType, cancellationToken).ConfigureAwait(false); if (ExceptionFactory != null) { var exception = ExceptionFactory("PostRestoreShardId", localVarResponse); if (exception != null) { throw exception; } } return localVarResponse; } } }