Logo

View the Project on GitHub elements-storage/elements-sdk-swift

StatusAPI

All URIs are relative to https://elements.local

Method HTTP request Description
getAlert GET /api/2/alerts/{id}  
getAllAlerts GET /api/2/alerts  
getTelegrafStats GET /api/2/telegraf-stats  
patchAlert PATCH /api/2/alerts/{id}  
submitKapacitorAlert POST /api/2/alerts/submit  
updateAlert PUT /api/2/alerts/{id}  

getAlert

    open class func getAlert( id: Int) -> Promise<Alert>

Required permissions * User account permission: system:status:view

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ElementsSDK

let id = 987 // Int | A unique integer value identifying this alert.

StatusAPI.getAlert(id: id).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

Name Type Description Notes
id Int A unique integer value identifying this alert.  

Return type

Alert

Authorization

Bearer

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getAllAlerts

    open class func getAllAlerts( isOpen: String? = nil,  id: Double? = nil,  ordering: String? = nil,  limit: Int? = nil,  offset: Int? = nil) -> Promise<[Alert]>

Required permissions * User account permission: system:status:view

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ElementsSDK

let isOpen = "isOpen_example" // String | Filter the returned list by `is_open`. (optional)
let id = 987 // Double | Filter the returned list by `id`. (optional)
let ordering = "ordering_example" // String | Which field to use when ordering the results. (optional)
let limit = 987 // Int | Number of results to return per page. (optional)
let offset = 987 // Int | The initial index from which to return the results. (optional)

StatusAPI.getAllAlerts(isOpen: isOpen, id: id, ordering: ordering, limit: limit, offset: offset).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

Name Type Description Notes
isOpen String Filter the returned list by `is_open`. [optional]
id Double Filter the returned list by `id`. [optional]
ordering String Which field to use when ordering the results. [optional]
limit Int Number of results to return per page. [optional]
offset Int The initial index from which to return the results. [optional]

Return type

[Alert]

Authorization

Bearer

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getTelegrafStats

    open class func getTelegrafStats() -> Promise<Void>

Required permissions * <class ‘rest_framework.permissions.AllowAny’>

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ElementsSDK


StatusAPI.getTelegrafStats().then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

This endpoint does not need any parameter.

Return type

Void (empty response body)

Authorization

Bearer

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patchAlert

    open class func patchAlert( id: Int,  alertPartialUpdate: AlertPartialUpdate) -> Promise<Alert>

Required permissions * User account permission: system:status:view

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ElementsSDK

let id = 987 // Int | A unique integer value identifying this alert.
let alertPartialUpdate = AlertPartialUpdate(name: "name_example", message: "message_example", level: "level_example", isOpen: false, closedAt: Date()) // AlertPartialUpdate | 

StatusAPI.patchAlert(id: id, alertPartialUpdate: alertPartialUpdate).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

Name Type Description Notes
id Int A unique integer value identifying this alert.  
alertPartialUpdate AlertPartialUpdate    

Return type

Alert

Authorization

Bearer

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

submitKapacitorAlert

    open class func submitKapacitorAlert( kapacitorAlert: KapacitorAlert) -> Promise<Void>

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ElementsSDK

let kapacitorAlert = KapacitorAlert(id: "id_example", level: "level_example", message: "message_example", details: "details_example", data: "TODO") // KapacitorAlert | 

StatusAPI.submitKapacitorAlert(kapacitorAlert: kapacitorAlert).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

Name Type Description Notes
kapacitorAlert KapacitorAlert    

Return type

Void (empty response body)

Authorization

Bearer

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateAlert

    open class func updateAlert( id: Int,  alert: Alert) -> Promise<Alert>

Required permissions * User account permission: system:status:view

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import ElementsSDK

let id = 987 // Int | A unique integer value identifying this alert.
let alert = Alert(id: 123, name: "name_example", message: "message_example", level: "level_example", isOpen: false, node: StorageNodeMini(id: 123, name: "name_example", address: "address_example", type: 123), openedAt: Date(), closedAt: Date(), duration: "duration_example") // Alert | 

StatusAPI.updateAlert(id: id, alert: alert).then {
         // when the promise is fulfilled
     }.always {
         // regardless of whether the promise is fulfilled, or rejected
     }.catch { errorType in
         // when the promise is rejected
}

Parameters

Name Type Description Notes
id Int A unique integer value identifying this alert.  
alert Alert    

Return type

Alert

Authorization

Bearer

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]