Skip to content

Latest commit

 

History

History
261 lines (169 loc) · 7.69 KB

AlertsApi.md

File metadata and controls

261 lines (169 loc) · 7.69 KB

SematextApiClientJavascript.AlertsApi

All URIs are relative to /

Method HTTP request Description
createAlertUsingPOST POST /users-web/api/v3/alerts Create alert rule
deleteAlertRuleUsingDELETE DELETE /users-web/api/v3/alerts/{updateableAlertId} Delete alert rule
disableAlertRuleUsingPUT1 PUT /users-web/api/v3/alerts/{updateableAlertId}/disable Disable alert rule
enableAlertRuleUsingPUT PUT /users-web/api/v3/alerts/{updateableAlertId}/enable Enable alert rule
getAlertRulesForAppUsingGET GET /users-web/api/v3/apps/{appId}/alerts Get alert rules for an app

createAlertUsingPOST

AlertRuleResponse createAlertUsingPOST(body)

Create alert rule

Example

import {SematextApiClientJavascript} from 'sematext-api-client-javascript';
let defaultClient = SematextApiClientJavascript.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SematextApiClientJavascript.AlertsApi();
let body = new SematextApiClientJavascript.AlertRule(); // AlertRule | dto

apiInstance.createAlertUsingPOST(body).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
body AlertRule dto

Return type

AlertRuleResponse

Authorization

api_key

HTTP request headers

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

deleteAlertRuleUsingDELETE

GenericMapBasedApiResponse deleteAlertRuleUsingDELETE(updateableAlertId)

Delete alert rule

Example

import {SematextApiClientJavascript} from 'sematext-api-client-javascript';
let defaultClient = SematextApiClientJavascript.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SematextApiClientJavascript.AlertsApi();
let updateableAlertId = 789; // Number | updateableAlertId

apiInstance.deleteAlertRuleUsingDELETE(updateableAlertId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
updateableAlertId Number updateableAlertId

Return type

GenericMapBasedApiResponse

Authorization

api_key

HTTP request headers

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

disableAlertRuleUsingPUT1

GenericMapBasedApiResponse disableAlertRuleUsingPUT1(updateableAlertId)

Disable alert rule

Example

import {SematextApiClientJavascript} from 'sematext-api-client-javascript';
let defaultClient = SematextApiClientJavascript.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SematextApiClientJavascript.AlertsApi();
let updateableAlertId = 789; // Number | updateableAlertId

apiInstance.disableAlertRuleUsingPUT1(updateableAlertId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
updateableAlertId Number updateableAlertId

Return type

GenericMapBasedApiResponse

Authorization

api_key

HTTP request headers

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

enableAlertRuleUsingPUT

GenericMapBasedApiResponse enableAlertRuleUsingPUT(updateableAlertId)

Enable alert rule

Example

import {SematextApiClientJavascript} from 'sematext-api-client-javascript';
let defaultClient = SematextApiClientJavascript.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SematextApiClientJavascript.AlertsApi();
let updateableAlertId = 789; // Number | updateableAlertId

apiInstance.enableAlertRuleUsingPUT(updateableAlertId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
updateableAlertId Number updateableAlertId

Return type

GenericMapBasedApiResponse

Authorization

api_key

HTTP request headers

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

getAlertRulesForAppUsingGET

AlertRulesResponse getAlertRulesForAppUsingGET(appId)

Get alert rules for an app

Example

import {SematextApiClientJavascript} from 'sematext-api-client-javascript';
let defaultClient = SematextApiClientJavascript.ApiClient.instance;

// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

let apiInstance = new SematextApiClientJavascript.AlertsApi();
let appId = 789; // Number | appId

apiInstance.getAlertRulesForAppUsingGET(appId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
appId Number appId

Return type

AlertRulesResponse

Authorization

api_key

HTTP request headers

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