Skip to content

Latest commit

 

History

History
167 lines (113 loc) · 5.81 KB

File metadata and controls

167 lines (113 loc) · 5.81 KB

event-detection

Event Detection API

  • API version: 7.0.20

Event detection occurs when ThousandEyes identifies that error signals related to a component (proxy, network node, AS, server etc) have deviated from the baselines established by events.

  • To determine this, ThousandEyes takes the test results from all accounts groups within an organization, and analyzes that data.
  • Noisy test results (those that have too many errors in a short window) are removed until they stabilize, and the rest of the results are tagged with the components associated with that test result (for example, proxy, network, or server).
  • Next, any increase in failures from the test results and each component helps in determining the problem domain and which component may be at fault.
  • When this failure rate increases beyond a pre-defined threshold (set by the algorithm), an event is triggered and an email notification is sent to the user (if they've enabled email alerts).

With the Events API, you can perform the following tasks on the ThousandEyes platform:

  • Retrieve Events: Obtain a list of events and detailed information for each event. For more information about events, see Event Detection.

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 11+
  2. Maven/Gradle

Installation

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.

Maven users

Add this dependency to your project's POM:

<dependencies>
    <dependency>
        <groupId>com.thousandeyes.sdk</groupId>
        <artifactId>event-detection</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>

Gradle users

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:event-detection:<version>"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/event-detection-version.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.thousandeyes.sdk.event.*;
import com.thousandeyes.sdk.event.client.*;
import com.thousandeyes.sdk.event.detection.model.*;
import com.thousandeyes.sdk.event.detection.EventsApi;

public class EventsApiExample {

    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();

        EventsApi apiInstance = new EventsApi(defaultClient);
        UUID id = UUID.fromString("e9c3bf02-a48c-4aa8-9e5f-898800d6f569"); // UUID | Unique event ID.
        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 {
            EventDetail result = apiInstance.getEvent(id, aid);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling EventsApi#getEvent");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.thousandeyes.com/v7

Class Method HTTP request Description
EventsApi getEvent GET /events/{id} Retrieve event
EventsApi getEventWithHttpInfo GET /events/{id} Retrieve event
EventsApi getEvents GET /events List events
EventsApi getEventsWithHttpInfo GET /events List events

Documentation for Authorization

Authentication schemes defined for the API:

BearerAuth

  • Type: HTTP Bearer Token authentication

Recommendation

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.

Author