C8yAlarmsService

public class C8yAlarmsService : JcConnectionRequest<C8yCumulocityConnection>

Allows alarms to fetched and posted to Cumulocity

Refer to the c8y API documentation for more information

  • Used when fetching C8yAlarms to determines the maximum number allowed in a single request, default is 50

    Declaration

    Swift

    public var pageSize: Int
  • Undocumented

    Declaration

    Swift

    public var version: String
  • Retrieves the C8yAlarm details for the given c8y internal id

    Declaration

    Swift

    public func get(_ id: String, pageNum: Int) -> AnyPublisher<JcRequestResponse<C8yAlarm>, APIError>
  • Retrieves a paged collection C8yPagedAlarms of C8yAlarm instances limited to the size of property pageSize.

    Notes:

    Call the function repeatedly to receive the next page if the number of alarms is the same size as the pageSize

    Declaration

    Swift

    public func get(source: String, status: C8yAlarm.Status, pageNum: Int) -> AnyPublisher<JcRequestResponse<C8yPagedAlarms>, APIError>
  • Creates a new C8yAlarm in Cumulocity

    Throws

    throws triggered in the alarm is missing mandatory data or references an invalid managed object

    Declaration

    Swift

    public func post(_ alarm: C8yAlarm) throws -> AnyPublisher<JcRequestResponse<String?>, APIError>
  • Used to update the status of an existing alarm. i.e. acknowledged, cleared etc.

    Declaration

    Swift

    public func put(_ alarm: C8yAlarm) throws -> AnyPublisher<JcRequestResponse<Bool>, APIError>