Alerts API
- API version: 7.0.32
You can manage the following alert functionalities on the ThousandEyes platform using the Alerts API:
-
Alerts: Retrieve alert details. Alerts are assigned to tests through alert rules.
-
Alert Rules: Conditions that you configure in order to highlight or be notified of events of interest in your ThousandEyes tests. When an alert rule’s conditions are met, the associated alert is triggered and the alert becomes active. It remains active until the alert is cleared. Alert rules are reusable across multiple tests..
-
Alert Suppression Windows: Suppress alerts for tests during periods such as planned maintenance. Windows can be one-time events or recurring events to handle periodic occurrences such as monthly downtime for maintenance.
For more information about the alerts, see Alerts.
Automatically generated by the OpenAPI Generator
Building the API client library requires:
- Java 11+
- Maven/Gradle
To install the API client library to your local Maven repository, simply execute:
mvn clean install
To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:
mvn clean deploy
Refer to the OSSRH Guide for more information.
Add this dependency to your project's POM:
<dependencies>
<dependency>
<groupId>com.thousandeyes.sdk</groupId>
<artifactId>alerts</artifactId>
<version>version</version>
</dependency>
<dependency>
<groupId>com.thousandeyes.sdk</groupId>
<artifactId>client</artifactId>
<version>version</version>
</dependency>
<!-- Example only, you can use your own client implementation -->
<dependency>
<groupId>com.thousandeyes.sdk</groupId>
<artifactId>client-native</artifactId>
<version>version</version>
</dependency>
</dependencies>
Add this dependency to your project's build file:
implementation "com.thousandeyes.sdk:client:<version>"
implementation "com.thousandeyes.sdk:client-native:<version>" #Example only, you can use your own client implementation
implementation "com.thousandeyes.sdk:alerts:<version>"
At first generate the JAR by executing:
mvn clean package
Then manually install the following JARs:
target/alerts-version.jar
target/lib/*.jar
Please follow the installation instruction and execute the following Java code:
import com.thousandeyes.sdk.*;
import com.thousandeyes.sdk.client.*;
import com.thousandeyes.sdk.alerts.model.*;
import com.thousandeyes.sdk.alerts.AlertRulesApi;
public class AlertRulesApiExample {
public static void main(String[] args) {
// Configure clients using the `defaultClient` object, such as
// overriding the host and port, timeout, etc. In this example we are using the NativeApiClient
// but you can use your own client implementation
ApiClient defaultClient = NativeApiClient
.builder()
.baseUri("https://api.thousandeyes.com/v7")
.bearerToken("<bearer-token>")
.build();
AlertRulesApi apiInstance = new AlertRulesApi(defaultClient);
RuleDetailUpdate ruleDetailUpdate = new RuleDetailUpdate(); // RuleDetailUpdate |
String aid = "1234"; // String | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response.
try {
Rule result = apiInstance.createAlertRule(ruleDetailUpdate, aid);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling AlertRulesApi#createAlertRule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
All URIs are relative to https://api.thousandeyes.com/v7
Class | Method | HTTP request | Description |
---|---|---|---|
AlertRulesApi | createAlertRule | POST /alerts/rules | Create alert rule |
AlertRulesApi | createAlertRuleWithHttpInfo | POST /alerts/rules | Create alert rule |
AlertRulesApi | deleteAlertRule | DELETE /alerts/rules/{ruleId} | Delete alert rule |
AlertRulesApi | deleteAlertRuleWithHttpInfo | DELETE /alerts/rules/{ruleId} | Delete alert rule |
AlertRulesApi | getAlertRule | GET /alerts/rules/{ruleId} | Retrieve alert rule |
AlertRulesApi | getAlertRuleWithHttpInfo | GET /alerts/rules/{ruleId} | Retrieve alert rule |
AlertRulesApi | getAlertsRules | GET /alerts/rules | List alert rules |
AlertRulesApi | getAlertsRulesWithHttpInfo | GET /alerts/rules | List alert rules |
AlertRulesApi | updateAlertRule | PUT /alerts/rules/{ruleId} | Update alert rule |
AlertRulesApi | updateAlertRuleWithHttpInfo | PUT /alerts/rules/{ruleId} | Update alert rule |
AlertSuppressionWindowsApi | createAlertSuppressionWindow | POST /alert-suppression-windows | Create alert suppression window |
AlertSuppressionWindowsApi | createAlertSuppressionWindowWithHttpInfo | POST /alert-suppression-windows | Create alert suppression window |
AlertSuppressionWindowsApi | deleteAlertSuppressionWindow | DELETE /alert-suppression-windows/{windowId} | Delete alert suppression window |
AlertSuppressionWindowsApi | deleteAlertSuppressionWindowWithHttpInfo | DELETE /alert-suppression-windows/{windowId} | Delete alert suppression window |
AlertSuppressionWindowsApi | getAlertSuppressionWindow | GET /alert-suppression-windows/{windowId} | Retrieve alert suppression window |
AlertSuppressionWindowsApi | getAlertSuppressionWindowWithHttpInfo | GET /alert-suppression-windows/{windowId} | Retrieve alert suppression window |
AlertSuppressionWindowsApi | getAlertSuppressionWindows | GET /alert-suppression-windows | List alert suppression windows |
AlertSuppressionWindowsApi | getAlertSuppressionWindowsWithHttpInfo | GET /alert-suppression-windows | List alert suppression windows |
AlertSuppressionWindowsApi | updateAlertSuppressionWindow | PUT /alert-suppression-windows/{windowId} | Update alert suppression window |
AlertSuppressionWindowsApi | updateAlertSuppressionWindowWithHttpInfo | PUT /alert-suppression-windows/{windowId} | Update alert suppression window |
AlertsApi | getAlert | GET /alerts/{alertId} | Retrieve alert details |
AlertsApi | getAlertWithHttpInfo | GET /alerts/{alertId} | Retrieve alert details |
AlertsApi | getAlerts | GET /alerts | List active alerts |
AlertsApi | getAlertsWithHttpInfo | GET /alerts | List active alerts |
Authentication schemes defined for the API:
- Type: HTTP Bearer Token authentication
It's recommended to create an instance of ApiClient
per thread in a multithreaded environment to avoid any potential issues.
However, the instances of the api clients created from the ApiClient
are thread-safe and can be re-used.