/// <summary>
        /// Delete Time series data from InfluxDB.
        /// </summary>
        /// <param name="predicate">Predicate delete request</param>
        /// <param name="bucket">The bucket from which data will be deleted</param>
        /// <param name="org">The organization of the above bucket</param>
        public async Task Delete(DeletePredicateRequest predicate, string bucket, string org)
        {
            Arguments.CheckNotNull(predicate, "Predicate is required");
            Arguments.CheckNonEmptyString(bucket, "Bucket is required");
            Arguments.CheckNonEmptyString(org, "Organization is required");

            await _service.DeletePostAsync(predicate, null, org, bucket, null, null);
        }
        /// <summary>
        /// Delete Time series data from InfluxDB.
        /// </summary>
        /// <param name="start">Start time</param>
        /// <param name="stop">Stop time</param>
        /// <param name="predicate">Sql where like delete statement</param>
        /// <param name="bucket">The bucket from which data will be deleted</param>
        /// <param name="org">The organization of the above bucket</param>
        public async Task Delete(DateTime start, DateTime stop, string predicate, string bucket, string org)
        {
            Arguments.CheckNotNull(start, "Start is required");
            Arguments.CheckNotNull(stop, "Stop is required");
            Arguments.CheckNotNull(predicate, "Predicate is required");
            Arguments.CheckNonEmptyString(bucket, "Bucket is required");
            Arguments.CheckNonEmptyString(org, "Organization is required");

            var predicateRequest = new DeletePredicateRequest(start, stop, predicate);

            await Delete(predicateRequest, bucket, org);
        }
Beispiel #3
0
        public async Task Delete(DataSourceIdentification dataSourceIdentification, DeletePredicateRequest deletePredicate)
        {
            if (dataSourceIdentification is null)
            {
                throw new ArgumentException(ParameterErrorMessage, nameof(dataSourceIdentification));
            }

            if (deletePredicate is null)
            {
                throw new ArgumentException(ParameterErrorMessage, nameof(deletePredicate));
            }

            await this.context.Client.GetDeleteApi().Delete(deletePredicate, dataSourceIdentification.Bucket, dataSourceIdentification.Organization).ConfigureAwait(false);
        }