DeleteAPI

public class DeleteAPI

Delete time series data from InfluxDB 2.x.

Example:

let predicateRequest = DeletePredicateRequest(
       start: Date(timeIntervalSince1970: 0),
       stop: Date(),
       predicate: "_measurement=\"server\" AND production=\"no\"")

try await client.deleteAPI.delete(predicate: predicateRequest, bucket: "my-bucket", org: "my-org")

print("Successfully data data by:\n\n\(predicateRequest)")
  • Delete points from an InfluxDB by specified predicate.

    Declaration

    Swift

    public func delete(predicate: DeletePredicateRequest,
                       bucket: String? = nil,
                       bucketID: String? = nil,
                       org: String? = nil,
                       orgID: String? = nil,
                       responseQueue: DispatchQueue = .main,
                       completion: @escaping (_ response: Void?,
                                              _ error: InfluxDBClient.InfluxDBError?) -> Void)

    Parameters

    predicate

    Delete predicate statement.

    bucket

    Specifies the bucket to delete data from.

    bucketID

    Specifies the bucket ID to delete data from.

    org

    Specifies the organization to delete data from.

    orgID

    Specifies the organization ID of the resource.

    responseQueue

    The queue on which api response is dispatched.

    completion

    completion handler to receive the data and the error objects

  • Delete points from an InfluxDB by specified predicate.

    Declaration

    Swift

    public func delete(predicate: DeletePredicateRequest,
                       bucket: String? = nil,
                       bucketID: String? = nil,
                       org: String? = nil,
                       orgID: String? = nil,
                       responseQueue: DispatchQueue = .main,
                       completion: @escaping (
                               _ result: Swift.Result<Void, InfluxDBClient.InfluxDBError>) -> Void)

    Parameters

    predicate

    Delete predicate statement.

    bucket

    Specifies the bucket to delete data from.

    bucketID

    Specifies the bucket ID to delete data from.

    org

    Specifies the organization to delete data from.

    orgID

    Specifies the organization ID of the resource.

    responseQueue

    The queue on which api response is dispatched.

    completion

    completion handler to receive the Swift.Result

  • Delete points from an InfluxDB by specified predicate.

    Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
    public func delete(predicate: DeletePredicateRequest,
                       bucket: String? = nil,
                       bucketID: String? = nil,
                       org: String? = nil,
                       orgID: String? = nil,
                       responseQueue: DispatchQueue = .main) -> AnyPublisher<Void, InfluxDBClient.InfluxDBError>

    Parameters

    predicate

    Delete predicate statement.

    bucket

    Specifies the bucket to delete data from.

    bucketID

    Specifies the bucket ID to delete data from.

    org

    Specifies the organization to delete data from.

    orgID

    Specifies the organization ID of the resource.

    responseQueue

    The queue on which api response is dispatched.

    completion

    completion handler to receive the Swift.Result

  • Asynchronously delete points from an InfluxDB by specified predicate.

    Declaration

    Swift

    @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *)
    public func delete(predicate: DeletePredicateRequest,
                       bucket: String? = nil,
                       bucketID: String? = nil,
                       org: String? = nil,
                       orgID: String? = nil,
                       responseQueue: DispatchQueue = .main) async throws

    Parameters

    predicate

    Delete predicate statement.

    bucket

    Specifies the bucket to delete data from.

    bucketID

    Specifies the bucket ID to delete data from.

    org

    Specifies the organization to delete data from.

    orgID

    Specifies the organization ID of the resource.

    responseQueue

    The queue on which api response is dispatched.