ackAlertById
ack alert by id
/alert/alerts/{id}/ack
Usage and SDK Samples
curl -X POST -H "Authorization: [[apiKey]]" "https://localhost/santaba/rest/alert/alerts/{id}/ack"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.LMApi;
import java.io.File;
import java.util.*;
public class LMApiExample {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
// Configure API key authorization: LMv1
ApiKeyAuth LMv1 = (ApiKeyAuth) defaultClient.getAuthentication("LMv1");
LMv1.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//LMv1.setApiKeyPrefix("Token");
LMApi apiInstance = new LMApi();
AlertAck body = ; // AlertAck |
String id = id_example; // String |
try {
Object result = apiInstance.ackAlertById(body, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LMApi#ackAlertById");
e.printStackTrace();
}
}
}
import io.swagger.client.api.LMApi;
public class LMApiExample {
public static void main(String[] args) {
LMApi apiInstance = new LMApi();
AlertAck body = ; // AlertAck |
String id = id_example; // String |
try {
Object result = apiInstance.ackAlertById(body, id);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling LMApi#ackAlertById");
e.printStackTrace();
}
}
}
Configuration *apiConfig = [Configuration sharedConfig];
// Configure API key authorization: (authentication scheme: LMv1)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Authorization"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"Authorization"];
AlertAck *body = ; //
String *id = id_example; //
LMApi *apiInstance = [[LMApi alloc] init];
// ack alert by id
[apiInstance ackAlertByIdWith:body
id:id
completionHandler: ^(Object output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var LogicMonitorRestApi = require('logic_monitor_rest_api');
var defaultClient = LogicMonitorRestApi.ApiClient.instance;
// Configure API key authorization: LMv1
var LMv1 = defaultClient.authentications['LMv1'];
LMv1.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//LMv1.apiKeyPrefix['Authorization'] = "Token"
var api = new LogicMonitorRestApi.LMApi()
var body = ; // {AlertAck}
var id = id_example; // {String}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.ackAlertById(body, id, callback);
using System;
using System.Diagnostics;
using logicmonitor_sdk.Api;
using logicmonitor_sdk.Client;
using logicmonitor_sdk.Model;
namespace Example
{
public class ackAlertByIdExample
{
public void main()
{
// Configure API key authorization: LMv1
Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");
var apiInstance = new LMApi();
var body = new AlertAck(); // AlertAck |
var id = id_example; // String |
try
{
// ack alert by id
Object result = apiInstance.ackAlertById(body, id);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling LMApi.ackAlertById: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: LMv1
Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');
$api_instance = new Swagger\Client\Api\LMApi();
$body = ; // AlertAck |
$id = id_example; // String |
try {
$result = $api_instance->ackAlertById($body, $id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling LMApi->ackAlertById: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::LMApi;
# Configure API key authorization: LMv1
$WWW::SwaggerClient::Configuration::api_key->{'Authorization'} = 'YOUR_API_KEY';
# uncomment below to setup prefix (e.g. Bearer) for API key, if needed
#$WWW::SwaggerClient::Configuration::api_key_prefix->{'Authorization'} = "Bearer";
my $api_instance = WWW::SwaggerClient::LMApi->new();
my $body = WWW::SwaggerClient::Object::AlertAck->new(); # AlertAck |
my $id = id_example; # String |
eval {
my $result = $api_instance->ackAlertById(body => $body, id => $id);
print Dumper($result);
};
if ($@) {
warn "Exception when calling LMApi->ackAlertById: $@\n";
}
from __future__ import print_function
import time
import logicmonitor_sdk
from logicmonitor_sdk.rest import ApiException
from pprint import pprint
# Configure API key authorization: LMv1
configuration = logicmonitor_sdk.Configuration()
configuration.company = 'YOUR_COMPANY'
configuration.access_id = 'YOUR_ACCESS_ID'
configuration.access_key = 'YOUR_ACCESS_KEY'
# create an instance of the API class
api_instance = logicmonitor_sdk.LMApi(logicmonitor_sdk.ApiClient(configuration))
try:
# ack alert by id
api_response = api_instance.ack_alert_by_id(body, id)
pprint(api_response)
except ApiException as e:
print("Exception when calling LMApi->ackAlertById: %s\n" % e)
package main
import (
"fmt"
"github.com/logicmonitor/lm-sdk-go/client"
"github.com/logicmonitor/lm-sdk-go/client/lm"
)
func main() {
// Configure API key authorization: LMv1
domain := "YOUR_COMPANY.logicmonitor.com"
accessID := "YOUR_ACCESS_ID"
accessKey := "YOUR_ACCESS_KEY"
config := client.NewConfig()
config.SetAccountDomain(&domain)
config.SetAccessID(&accessID)
config.SetAccessKey(&accessKey)
// create an instance of the API class
client := client.New(config)
params := lm.NewAckAlertByIDParams()
// ack alert by id
resp, err := client.LM.AckAlertByID(params)
if err != nil {
fmt.Printf("Exception when calling client.LM.AckAlertByID: %v", err.Error())
}
fmt.Print(resp)
}
Parameters
Name | Description |
---|---|
id* |
String
Required
|
Name | Description |
---|---|
body * |