# alerts-api

## Overview
Manage all alerts, alert rules and alert suppression windows.

This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 7.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.

Python 3.7+

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/thousandeyes/thousandeyes-python-sdk.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/thousandeyes/thousandeyes-python-sdk.git`)

Then import the package:
```python
import alerts_api
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import alerts_api
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import time
import alerts_api
from alerts_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = alerts_api.Configuration(
    host = "https://api.thousandeyes.com"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: BearerAuth
configuration = alerts_api.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with alerts_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = alerts_api.AlertRulesApi(api_client)
    rule_detail_update = alerts_api.RuleDetailUpdate() # RuleDetailUpdate | 
    aid = '2067' # str | 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. (optional)

    try:
        # Create alert rule
        api_response = api_instance.create_alert_rule(rule_detail_update, aid=aid)
        print("The response of AlertRulesApi->create_alert_rule:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling AlertRulesApi->create_alert_rule: %s\n" % e)

```

## Documentation for API Endpoints

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

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*AlertRulesApi* | [**create_alert_rule**](docs/AlertRulesApi.md#create_alert_rule) | **POST** /v7/alerts/rules | Create alert rule
*AlertRulesApi* | [**delete_alert_rule**](docs/AlertRulesApi.md#delete_alert_rule) | **DELETE** /v7/alerts/rules/{ruleId} | Delete alert rule
*AlertRulesApi* | [**get_alert_rule_details**](docs/AlertRulesApi.md#get_alert_rule_details) | **GET** /v7/alerts/rules/{ruleId} | Retrieve alert rule
*AlertRulesApi* | [**get_alerts_rules**](docs/AlertRulesApi.md#get_alerts_rules) | **GET** /v7/alerts/rules | List alert rules
*AlertRulesApi* | [**update_alert_rule**](docs/AlertRulesApi.md#update_alert_rule) | **PUT** /v7/alerts/rules/{ruleId} | Update alert rule
*AlertSuppressionWindowsApi* | [**create_suppression_windows**](docs/AlertSuppressionWindowsApi.md#create_suppression_windows) | **POST** /v7/alert-suppression-windows | Create alert suppression window
*AlertSuppressionWindowsApi* | [**delete_suppression_window**](docs/AlertSuppressionWindowsApi.md#delete_suppression_window) | **DELETE** /v7/alert-suppression-windows/{windowId} | Delete alert suppression window
*AlertSuppressionWindowsApi* | [**get_suppression_window_details**](docs/AlertSuppressionWindowsApi.md#get_suppression_window_details) | **GET** /v7/alert-suppression-windows/{windowId} | Retrieve alert suppression window
*AlertSuppressionWindowsApi* | [**get_suppression_windows**](docs/AlertSuppressionWindowsApi.md#get_suppression_windows) | **GET** /v7/alert-suppression-windows | List alert suppression windows
*AlertSuppressionWindowsApi* | [**update_suppression_window**](docs/AlertSuppressionWindowsApi.md#update_suppression_window) | **PUT** /v7/alert-suppression-windows/{windowId} | Update alert suppression window
*AlertsApi* | [**get_alert_details**](docs/AlertsApi.md#get_alert_details) | **GET** /v7/alerts/{alertId} | Retrieve alert details
*AlertsApi* | [**get_alerts**](docs/AlertsApi.md#get_alerts) | **GET** /v7/alerts | List active alerts


## Documentation For Models

 - [Alert](docs/Alert.md)
 - [AlertDetail](docs/AlertDetail.md)
 - [AlertLinks](docs/AlertLinks.md)
 - [AlertMetricDetail](docs/AlertMetricDetail.md)
 - [AlertMetricDetailEnd](docs/AlertMetricDetailEnd.md)
 - [AlertMetricDetailStart](docs/AlertMetricDetailStart.md)
 - [AlertMetrics](docs/AlertMetrics.md)
 - [AlertRoundsViolationMode](docs/AlertRoundsViolationMode.md)
 - [AlertRule](docs/AlertRule.md)
 - [AlertSuppressionWindow](docs/AlertSuppressionWindow.md)
 - [AlertSuppressionWindowRequest](docs/AlertSuppressionWindowRequest.md)
 - [AlertSuppressionWindowState](docs/AlertSuppressionWindowState.md)
 - [AlertSuppressionWindows](docs/AlertSuppressionWindows.md)
 - [AlertSuppressionWindowsAlertSuppressionWindowsInner](docs/AlertSuppressionWindowsAlertSuppressionWindowsInner.md)
 - [AlertType](docs/AlertType.md)
 - [Alerts](docs/Alerts.md)
 - [AppLinks](docs/AppLinks.md)
 - [AppLinksLinks](docs/AppLinksLinks.md)
 - [BaseAlert](docs/BaseAlert.md)
 - [BaseTest](docs/BaseTest.md)
 - [CompleteAlertSuppressionWindow](docs/CompleteAlertSuppressionWindow.md)
 - [CreateAlertRule201Response](docs/CreateAlertRule201Response.md)
 - [CreateSuppressionWindows201Response](docs/CreateSuppressionWindows201Response.md)
 - [DaysOfWeek](docs/DaysOfWeek.md)
 - [EndRepeat](docs/EndRepeat.md)
 - [EndRepeatType](docs/EndRepeatType.md)
 - [Error](docs/Error.md)
 - [Expand](docs/Expand.md)
 - [GetAlertRuleDetails200Response](docs/GetAlertRuleDetails200Response.md)
 - [GetAlerts200Response](docs/GetAlerts200Response.md)
 - [GetAlertsRules200Response](docs/GetAlertsRules200Response.md)
 - [GetSuppressionWindows200Response](docs/GetSuppressionWindows200Response.md)
 - [IntervalType](docs/IntervalType.md)
 - [Link](docs/Link.md)
 - [Notification](docs/Notification.md)
 - [NotificationEmail](docs/NotificationEmail.md)
 - [NotificationThirdParty](docs/NotificationThirdParty.md)
 - [NotificationWebhook](docs/NotificationWebhook.md)
 - [PaginationLinks](docs/PaginationLinks.md)
 - [PaginationLinksLinks](docs/PaginationLinksLinks.md)
 - [Repeat](docs/Repeat.md)
 - [RepeatType](docs/RepeatType.md)
 - [Rule](docs/Rule.md)
 - [RuleDetail](docs/RuleDetail.md)
 - [RuleDetailUpdate](docs/RuleDetailUpdate.md)
 - [RuleLinks](docs/RuleLinks.md)
 - [RuleLinksLinks](docs/RuleLinksLinks.md)
 - [Rules](docs/Rules.md)
 - [SelfLinks](docs/SelfLinks.md)
 - [SelfLinksLinks](docs/SelfLinksLinks.md)
 - [Severity](docs/Severity.md)
 - [State](docs/State.md)
 - [TestDirection](docs/TestDirection.md)
 - [TestInterval](docs/TestInterval.md)
 - [ThirdPartyIntegrationType](docs/ThirdPartyIntegrationType.md)
 - [UnauthorizedError](docs/UnauthorizedError.md)
 - [UnexpandedTest](docs/UnexpandedTest.md)
 - [WebhookIntegrationType](docs/WebhookIntegrationType.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="BearerAuth"></a>
### BearerAuth

- **Type**: Bearer authentication


## Author




