Skip to content
This repository has been archived by the owner on Jul 24, 2023. It is now read-only.

Latest commit

 

History

History
468 lines (352 loc) · 13.6 KB

StatusApi.md

File metadata and controls

468 lines (352 loc) · 13.6 KB

ElementsSDK.Api.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

Alert GetAlert (int id)

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class GetAlertExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new StatusApi(config);
            var id = 56;  // int | A unique integer value identifying this alert.

            try
            {
                Alert result = apiInstance.GetAlert(id);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling StatusApi.GetAlert: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

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

Return type

Alert

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

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

GetAllAlerts

List<Alert> GetAllAlerts (string isOpen = null, decimal? id = null, string ordering = null, int? limit = null, int? offset = null)

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class GetAllAlertsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new StatusApi(config);
            var isOpen = isOpen_example;  // string | Filter the returned list by `is_open`. (optional) 
            var id = 8.14;  // decimal? | Filter the returned list by `id`. (optional) 
            var ordering = ordering_example;  // string | Which field to use when ordering the results. (optional) 
            var limit = 56;  // int? | Number of results to return per page. (optional) 
            var offset = 56;  // int? | The initial index from which to return the results. (optional) 

            try
            {
                List<Alert> result = apiInstance.GetAllAlerts(isOpen, id, ordering, limit, offset);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling StatusApi.GetAllAlerts: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
isOpen string Filter the returned list by `is_open`. [optional]
id decimal? 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

List<Alert>

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

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

GetTelegrafStats

void GetTelegrafStats ()

Required permissions * <class 'rest_framework.permissions.AllowAny'>

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class GetTelegrafStatsExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new StatusApi(config);

            try
            {
                apiInstance.GetTelegrafStats();
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling StatusApi.GetTelegrafStats: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 No body -

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

PatchAlert

Alert PatchAlert (int id, AlertPartialUpdate alertPartialUpdate)

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class PatchAlertExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new StatusApi(config);
            var id = 56;  // int | A unique integer value identifying this alert.
            var alertPartialUpdate = new AlertPartialUpdate(); // AlertPartialUpdate | 

            try
            {
                Alert result = apiInstance.PatchAlert(id, alertPartialUpdate);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling StatusApi.PatchAlert: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

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

Return type

Alert

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

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

SubmitKapacitorAlert

void SubmitKapacitorAlert (KapacitorAlert kapacitorAlert)

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class SubmitKapacitorAlertExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new StatusApi(config);
            var kapacitorAlert = new KapacitorAlert(); // KapacitorAlert | 

            try
            {
                apiInstance.SubmitKapacitorAlert(kapacitorAlert);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling StatusApi.SubmitKapacitorAlert: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
kapacitorAlert KapacitorAlert

Return type

void (empty response body)

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 No body -

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

UpdateAlert

Alert UpdateAlert (int id, Alert alert)

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

Example

using System.Collections.Generic;
using System.Diagnostics;
using ElementsSDK.Api;
using ElementsSDK.Client;
using ElementsSDK.Model;

namespace Example
{
    public class UpdateAlertExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.BasePath = "https://elements.local";
            // Configure API key authorization: Bearer
            config.AddApiKey("Authorization", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // config.AddApiKeyPrefix("Authorization", "Bearer");

            var apiInstance = new StatusApi(config);
            var id = 56;  // int | A unique integer value identifying this alert.
            var alert = new Alert(); // Alert | 

            try
            {
                Alert result = apiInstance.UpdateAlert(id, alert);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling StatusApi.UpdateAlert: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

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

Return type

Alert

Authorization

Bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

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