From 09e9385636e4f301efbe91dc5b501e8949ed1f2e Mon Sep 17 00:00:00 2001 From: Shahid Hussain Khan <118099753+shahid-te@users.noreply.github.com> Date: Sun, 11 Aug 2024 10:21:46 +0100 Subject: [PATCH] Add Event detection API (#43) * [GitHub Bot] Generated python SDK * Updated README --------- Co-authored-by: API Team Co-authored-by: Miguel Pragosa --- README.md | 1 + .../.openapi-generator-ignore | 23 + .../.openapi-generator/FILES | 92 +++ .../.openapi-generator/VERSION | 1 + thousandeyes-sdk-event-detection/MANIFEST.in | 1 + thousandeyes-sdk-event-detection/README.md | 169 ++++ .../docs/AffectedAgents.md | 31 + .../docs/AffectedCount.md | 30 + .../docs/AffectedTargets.md | 31 + .../docs/AffectedTests.md | 31 + .../docs/AgentLinks.md | 30 + .../docs/AgentLocalEventDetail.md | 43 ++ .../docs/AgentLocalEventGrouping.md | 29 + .../docs/ApiAffectedAgent.md | 36 + .../docs/ApiAffectedTarget.md | 33 + .../docs/ApiAffectedTest.md | 34 + .../docs/CloudEnterpriseAgentType.md | 12 + .../docs/DnsEventDetail.md | 43 ++ .../docs/DnsEventGrouping.md | 29 + .../docs/Error.md | 33 + .../docs/Event.md | 40 + .../docs/EventDetail.md | 43 ++ .../docs/EventDetailBase.md | 41 + .../docs/EventState.md | 12 + .../docs/EventType.md | 12 + .../docs/Events.md | 33 + .../docs/EventsApi.md | 193 +++++ thousandeyes-sdk-event-detection/docs/Link.md | 37 + .../docs/NetworkEventDetail.md | 43 ++ .../docs/NetworkEventGrouping.md | 31 + .../docs/NetworkPopEventDetail.md | 43 ++ .../docs/PaginationNextAndSelfLinks.md | 31 + .../docs/ProxyEventDetail.md | 43 ++ .../docs/ProxyEventGrouping.md | 29 + .../docs/SelfLinks.md | 30 + .../docs/Severity.md | 12 + .../docs/SimpleEventDetail.md | 34 + .../docs/TargetEventDetail.md | 43 ++ .../docs/TargetEventGrouping.md | 29 + .../docs/TargetNetworkEventDetail.md | 43 ++ .../docs/TargetNetworkEventGrouping.md | 29 + .../docs/TestLinks.md | 30 + .../docs/TestType.md | 12 + .../docs/UnauthorizedError.md | 30 + .../docs/ValidationError.md | 34 + .../docs/ValidationErrorItem.md | 31 + .../pyproject.toml | 82 ++ thousandeyes-sdk-event-detection/setup.cfg | 2 + .../event_detection/__init__.py | 59 ++ .../event_detection/api/__init__.py | 5 + .../event_detection/api/events_api.py | 729 ++++++++++++++++++ .../event_detection/models/__init__.py | 54 ++ .../event_detection/models/affected_agents.py | 103 +++ .../event_detection/models/affected_count.py | 93 +++ .../models/affected_targets.py | 103 +++ .../event_detection/models/affected_tests.py | 103 +++ .../event_detection/models/agent_links.py | 91 +++ .../models/agent_local_event_detail.py | 156 ++++ .../models/agent_local_event_grouping.py | 89 +++ .../models/api_affected_agent.py | 114 +++ .../models/api_affected_target.py | 101 +++ .../models/api_affected_test.py | 106 +++ .../models/cloud_enterprise_agent_type.py | 37 + .../models/dns_event_detail.py | 156 ++++ .../models/dns_event_grouping.py | 89 +++ .../event_detection/models/error.py | 95 +++ .../event_detection/models/event.py | 137 ++++ .../event_detection/models/event_detail.py | 213 +++++ .../models/event_detail_base.py | 140 ++++ .../event_detection/models/event_state.py | 36 + .../event_detection/models/event_type.py | 41 + .../event_detection/models/events.py | 112 +++ .../event_detection/models/link.py | 101 +++ .../models/network_event_detail.py | 156 ++++ .../models/network_event_grouping.py | 97 +++ .../models/network_pop_event_detail.py | 156 ++++ .../models/pagination_next_and_self_links.py | 96 +++ .../models/proxy_event_detail.py | 156 ++++ .../models/proxy_event_grouping.py | 89 +++ .../event_detection/models/self_links.py | 91 +++ .../event_detection/models/severity.py | 37 + .../models/simple_event_detail.py | 108 +++ .../models/target_event_detail.py | 156 ++++ .../models/target_event_grouping.py | 89 +++ .../models/target_network_event_detail.py | 156 ++++ .../models/target_network_event_grouping.py | 89 +++ .../event_detection/models/test_links.py | 91 +++ .../event_detection/models/test_type.py | 47 ++ .../models/unauthorized_error.py | 89 +++ .../models/validation_error.py | 110 +++ .../models/validation_error_item.py | 91 +++ .../thousandeyes_sdk/event_detection/py.typed | 0 .../test/__init__.py | 0 .../test/test_events_api.py | 275 +++++++ .../test/test_utils.py | 16 + 95 files changed, 7062 insertions(+) create mode 100644 thousandeyes-sdk-event-detection/.openapi-generator-ignore create mode 100644 thousandeyes-sdk-event-detection/.openapi-generator/FILES create mode 100644 thousandeyes-sdk-event-detection/.openapi-generator/VERSION create mode 100644 thousandeyes-sdk-event-detection/MANIFEST.in create mode 100644 thousandeyes-sdk-event-detection/README.md create mode 100644 thousandeyes-sdk-event-detection/docs/AffectedAgents.md create mode 100644 thousandeyes-sdk-event-detection/docs/AffectedCount.md create mode 100644 thousandeyes-sdk-event-detection/docs/AffectedTargets.md create mode 100644 thousandeyes-sdk-event-detection/docs/AffectedTests.md create mode 100644 thousandeyes-sdk-event-detection/docs/AgentLinks.md create mode 100644 thousandeyes-sdk-event-detection/docs/AgentLocalEventDetail.md create mode 100644 thousandeyes-sdk-event-detection/docs/AgentLocalEventGrouping.md create mode 100644 thousandeyes-sdk-event-detection/docs/ApiAffectedAgent.md create mode 100644 thousandeyes-sdk-event-detection/docs/ApiAffectedTarget.md create mode 100644 thousandeyes-sdk-event-detection/docs/ApiAffectedTest.md create mode 100644 thousandeyes-sdk-event-detection/docs/CloudEnterpriseAgentType.md create mode 100644 thousandeyes-sdk-event-detection/docs/DnsEventDetail.md create mode 100644 thousandeyes-sdk-event-detection/docs/DnsEventGrouping.md create mode 100644 thousandeyes-sdk-event-detection/docs/Error.md create mode 100644 thousandeyes-sdk-event-detection/docs/Event.md create mode 100644 thousandeyes-sdk-event-detection/docs/EventDetail.md create mode 100644 thousandeyes-sdk-event-detection/docs/EventDetailBase.md create mode 100644 thousandeyes-sdk-event-detection/docs/EventState.md create mode 100644 thousandeyes-sdk-event-detection/docs/EventType.md create mode 100644 thousandeyes-sdk-event-detection/docs/Events.md create mode 100644 thousandeyes-sdk-event-detection/docs/EventsApi.md create mode 100644 thousandeyes-sdk-event-detection/docs/Link.md create mode 100644 thousandeyes-sdk-event-detection/docs/NetworkEventDetail.md create mode 100644 thousandeyes-sdk-event-detection/docs/NetworkEventGrouping.md create mode 100644 thousandeyes-sdk-event-detection/docs/NetworkPopEventDetail.md create mode 100644 thousandeyes-sdk-event-detection/docs/PaginationNextAndSelfLinks.md create mode 100644 thousandeyes-sdk-event-detection/docs/ProxyEventDetail.md create mode 100644 thousandeyes-sdk-event-detection/docs/ProxyEventGrouping.md create mode 100644 thousandeyes-sdk-event-detection/docs/SelfLinks.md create mode 100644 thousandeyes-sdk-event-detection/docs/Severity.md create mode 100644 thousandeyes-sdk-event-detection/docs/SimpleEventDetail.md create mode 100644 thousandeyes-sdk-event-detection/docs/TargetEventDetail.md create mode 100644 thousandeyes-sdk-event-detection/docs/TargetEventGrouping.md create mode 100644 thousandeyes-sdk-event-detection/docs/TargetNetworkEventDetail.md create mode 100644 thousandeyes-sdk-event-detection/docs/TargetNetworkEventGrouping.md create mode 100644 thousandeyes-sdk-event-detection/docs/TestLinks.md create mode 100644 thousandeyes-sdk-event-detection/docs/TestType.md create mode 100644 thousandeyes-sdk-event-detection/docs/UnauthorizedError.md create mode 100644 thousandeyes-sdk-event-detection/docs/ValidationError.md create mode 100644 thousandeyes-sdk-event-detection/docs/ValidationErrorItem.md create mode 100644 thousandeyes-sdk-event-detection/pyproject.toml create mode 100644 thousandeyes-sdk-event-detection/setup.cfg create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/__init__.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/api/__init__.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/api/events_api.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/__init__.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_agents.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_count.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_targets.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_tests.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_links.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_detail.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_grouping.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_agent.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_target.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_test.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/cloud_enterprise_agent_type.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_detail.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_grouping.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/error.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail_base.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_state.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_type.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/events.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/link.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_detail.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_grouping.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_pop_event_detail.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/pagination_next_and_self_links.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_detail.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_grouping.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/self_links.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/severity.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/simple_event_detail.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_detail.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_grouping.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_detail.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_grouping.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/test_links.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/test_type.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/unauthorized_error.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/validation_error.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/validation_error_item.py create mode 100644 thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/py.typed create mode 100644 thousandeyes-sdk-event-detection/test/__init__.py create mode 100644 thousandeyes-sdk-event-detection/test/test_events_api.py create mode 100644 thousandeyes-sdk-event-detection/test/test_utils.py diff --git a/README.md b/README.md index ba0bcc4bc..114a7960b 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Each of the APIs being published includes a README file with instructions on how * [credentials](/thousandeyes-sdk-credentials/README.md) * [dashboards](/thousandeyes-sdk-dashboards/README.md) * [emulation](/thousandeyes-sdk-emulation/README.md) +* [event-detection](/thousandeyes-sdk-event-detection/README.md) * [endpoint-agents](/thousandeyes-sdk-endpoint-agents/README.md) * [endpoint-instant-tests](/thousandeyes-sdk-endpoint-instant-tests/README.md) * [endpoint-labels](/thousandeyes-sdk-endpoint-labels/README.md) diff --git a/thousandeyes-sdk-event-detection/.openapi-generator-ignore b/thousandeyes-sdk-event-detection/.openapi-generator-ignore new file mode 100644 index 000000000..7484ee590 --- /dev/null +++ b/thousandeyes-sdk-event-detection/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/thousandeyes-sdk-event-detection/.openapi-generator/FILES b/thousandeyes-sdk-event-detection/.openapi-generator/FILES new file mode 100644 index 000000000..3c90a840a --- /dev/null +++ b/thousandeyes-sdk-event-detection/.openapi-generator/FILES @@ -0,0 +1,92 @@ +.openapi-generator-ignore +MANIFEST.in +README.md +docs/AffectedAgents.md +docs/AffectedCount.md +docs/AffectedTargets.md +docs/AffectedTests.md +docs/AgentLinks.md +docs/AgentLocalEventDetail.md +docs/AgentLocalEventGrouping.md +docs/ApiAffectedAgent.md +docs/ApiAffectedTarget.md +docs/ApiAffectedTest.md +docs/CloudEnterpriseAgentType.md +docs/DnsEventDetail.md +docs/DnsEventGrouping.md +docs/Error.md +docs/Event.md +docs/EventDetail.md +docs/EventDetailBase.md +docs/EventState.md +docs/EventType.md +docs/Events.md +docs/EventsApi.md +docs/Link.md +docs/NetworkEventDetail.md +docs/NetworkEventGrouping.md +docs/NetworkPopEventDetail.md +docs/PaginationNextAndSelfLinks.md +docs/ProxyEventDetail.md +docs/ProxyEventGrouping.md +docs/SelfLinks.md +docs/Severity.md +docs/SimpleEventDetail.md +docs/TargetEventDetail.md +docs/TargetEventGrouping.md +docs/TargetNetworkEventDetail.md +docs/TargetNetworkEventGrouping.md +docs/TestLinks.md +docs/TestType.md +docs/UnauthorizedError.md +docs/ValidationError.md +docs/ValidationErrorItem.md +pyproject.toml +setup.cfg +src/thousandeyes_sdk/event_detection/__init__.py +src/thousandeyes_sdk/event_detection/api/__init__.py +src/thousandeyes_sdk/event_detection/api/events_api.py +src/thousandeyes_sdk/event_detection/models/__init__.py +src/thousandeyes_sdk/event_detection/models/affected_agents.py +src/thousandeyes_sdk/event_detection/models/affected_count.py +src/thousandeyes_sdk/event_detection/models/affected_targets.py +src/thousandeyes_sdk/event_detection/models/affected_tests.py +src/thousandeyes_sdk/event_detection/models/agent_links.py +src/thousandeyes_sdk/event_detection/models/agent_local_event_detail.py +src/thousandeyes_sdk/event_detection/models/agent_local_event_grouping.py +src/thousandeyes_sdk/event_detection/models/api_affected_agent.py +src/thousandeyes_sdk/event_detection/models/api_affected_target.py +src/thousandeyes_sdk/event_detection/models/api_affected_test.py +src/thousandeyes_sdk/event_detection/models/cloud_enterprise_agent_type.py +src/thousandeyes_sdk/event_detection/models/dns_event_detail.py +src/thousandeyes_sdk/event_detection/models/dns_event_grouping.py +src/thousandeyes_sdk/event_detection/models/error.py +src/thousandeyes_sdk/event_detection/models/event.py +src/thousandeyes_sdk/event_detection/models/event_detail.py +src/thousandeyes_sdk/event_detection/models/event_detail_base.py +src/thousandeyes_sdk/event_detection/models/event_state.py +src/thousandeyes_sdk/event_detection/models/event_type.py +src/thousandeyes_sdk/event_detection/models/events.py +src/thousandeyes_sdk/event_detection/models/link.py +src/thousandeyes_sdk/event_detection/models/network_event_detail.py +src/thousandeyes_sdk/event_detection/models/network_event_grouping.py +src/thousandeyes_sdk/event_detection/models/network_pop_event_detail.py +src/thousandeyes_sdk/event_detection/models/pagination_next_and_self_links.py +src/thousandeyes_sdk/event_detection/models/proxy_event_detail.py +src/thousandeyes_sdk/event_detection/models/proxy_event_grouping.py +src/thousandeyes_sdk/event_detection/models/self_links.py +src/thousandeyes_sdk/event_detection/models/severity.py +src/thousandeyes_sdk/event_detection/models/simple_event_detail.py +src/thousandeyes_sdk/event_detection/models/target_event_detail.py +src/thousandeyes_sdk/event_detection/models/target_event_grouping.py +src/thousandeyes_sdk/event_detection/models/target_network_event_detail.py +src/thousandeyes_sdk/event_detection/models/target_network_event_grouping.py +src/thousandeyes_sdk/event_detection/models/test_links.py +src/thousandeyes_sdk/event_detection/models/test_type.py +src/thousandeyes_sdk/event_detection/models/unauthorized_error.py +src/thousandeyes_sdk/event_detection/models/validation_error.py +src/thousandeyes_sdk/event_detection/models/validation_error_item.py +src/thousandeyes_sdk/event_detection/py.typed +test/__init__.py +test/test_events_api.py +test/test_utils.py diff --git a/thousandeyes-sdk-event-detection/.openapi-generator/VERSION b/thousandeyes-sdk-event-detection/.openapi-generator/VERSION new file mode 100644 index 000000000..93c8ddab9 --- /dev/null +++ b/thousandeyes-sdk-event-detection/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.6.0 diff --git a/thousandeyes-sdk-event-detection/MANIFEST.in b/thousandeyes-sdk-event-detection/MANIFEST.in new file mode 100644 index 000000000..9a2248f55 --- /dev/null +++ b/thousandeyes-sdk-event-detection/MANIFEST.in @@ -0,0 +1 @@ +include docs/* diff --git a/thousandeyes-sdk-event-detection/README.md b/thousandeyes-sdk-event-detection/README.md new file mode 100644 index 000000000..572ccc964 --- /dev/null +++ b/thousandeyes-sdk-event-detection/README.md @@ -0,0 +1,169 @@ +# thousandeyes-sdk-event-detection + +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](https://docs.thousandeyes.com/product-documentation/event-detection). + + +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: 7.0.14 +- Generator version: 7.6.0 +- Build package: com.thousandeyes.api.codegen.ThousandeyesPythonGenerator + +## Requirements. + +Python 3.8+ + +## Installation & Usage +### pip install + +Install directly via PyPi: + +```sh +pip install thousandeyes-sdk-event-detection +``` +(you may need to run `pip` with root permission: `sudo pip install thousandeyes-sdk-event-detection`) + +Then import the package: +```python +import thousandeyes_sdk.event_detection +``` + +### 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 thousandeyes_sdk.event_detection +``` + +### Tests + +Execute `pytest` to run the tests. + +## Getting Started + +Please follow the installation procedure and then run the following: + +```python + +import thousandeyes_sdk.core +import thousandeyes_sdk.event_detection +from thousandeyes_sdk.core.exceptions 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 = thousandeyes_sdk.core.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 = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + + +# Enter a context with an instance of the API client +with thousandeyes_sdk.core.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.event_detection.EventsApi(api_client) + id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' # str | Unique event ID. + aid = '1234' # 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: + # Retrieve event + api_response = api_instance.get_event(id, aid=aid) + print("The response of EventsApi->get_event:\n") + pprint(api_response) + except ApiException as e: + print("Exception when calling EventsApi->get_event: %s\n" % e) + +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://api.thousandeyes.com* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*EventsApi* | [**get_event**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventsApi.md#get_event) | **GET** /v7/events/{id} | Retrieve event +*EventsApi* | [**get_events**](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventsApi.md#get_events) | **GET** /v7/events | List events + + +## Documentation For Models + + - [AffectedAgents](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/AffectedAgents.md) + - [AffectedCount](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/AffectedCount.md) + - [AffectedTargets](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/AffectedTargets.md) + - [AffectedTests](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/AffectedTests.md) + - [AgentLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/AgentLinks.md) + - [AgentLocalEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/AgentLocalEventDetail.md) + - [AgentLocalEventGrouping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/AgentLocalEventGrouping.md) + - [ApiAffectedAgent](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ApiAffectedAgent.md) + - [ApiAffectedTarget](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ApiAffectedTarget.md) + - [ApiAffectedTest](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ApiAffectedTest.md) + - [CloudEnterpriseAgentType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/CloudEnterpriseAgentType.md) + - [DnsEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/DnsEventDetail.md) + - [DnsEventGrouping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/DnsEventGrouping.md) + - [Error](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/Error.md) + - [Event](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/Event.md) + - [EventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventDetail.md) + - [EventDetailBase](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventDetailBase.md) + - [EventState](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventState.md) + - [EventType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/EventType.md) + - [Events](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/Events.md) + - [Link](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/Link.md) + - [NetworkEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/NetworkEventDetail.md) + - [NetworkEventGrouping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/NetworkEventGrouping.md) + - [NetworkPopEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/NetworkPopEventDetail.md) + - [PaginationNextAndSelfLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/PaginationNextAndSelfLinks.md) + - [ProxyEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ProxyEventDetail.md) + - [ProxyEventGrouping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ProxyEventGrouping.md) + - [SelfLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/SelfLinks.md) + - [Severity](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/Severity.md) + - [SimpleEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/SimpleEventDetail.md) + - [TargetEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TargetEventDetail.md) + - [TargetEventGrouping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TargetEventGrouping.md) + - [TargetNetworkEventDetail](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TargetNetworkEventDetail.md) + - [TargetNetworkEventGrouping](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TargetNetworkEventGrouping.md) + - [TestLinks](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TestLinks.md) + - [TestType](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/TestType.md) + - [UnauthorizedError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/UnauthorizedError.md) + - [ValidationError](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ValidationError.md) + - [ValidationErrorItem](https://github.com/thousandeyes/thousandeyes-sdk-python//tree/main/thousandeyes-sdk-event-detection/docs/ValidationErrorItem.md) + + + +## Documentation For Authorization + + +Authentication schemes defined for the API: + +### BearerAuth + +- **Type**: Bearer authentication + + +## Author + +ThousandEyes API Team + + diff --git a/thousandeyes-sdk-event-detection/docs/AffectedAgents.md b/thousandeyes-sdk-event-detection/docs/AffectedAgents.md new file mode 100644 index 000000000..2706b374d --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/AffectedAgents.md @@ -0,0 +1,31 @@ +# AffectedAgents + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | The total number affected. | [optional] [readonly] +**in_account_group** | **int** | Indicates if in the affected account group. | [optional] [readonly] +**agents** | [**List[ApiAffectedAgent]**](ApiAffectedAgent.md) | List of affected agents. | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents + +# TODO update the JSON string below +json = "{}" +# create an instance of AffectedAgents from a JSON string +affected_agents_instance = AffectedAgents.from_json(json) +# print the JSON string representation of the object +print(AffectedAgents.to_json()) + +# convert the object into a dict +affected_agents_dict = affected_agents_instance.to_dict() +# create an instance of AffectedAgents from a dict +affected_agents_from_dict = AffectedAgents.from_dict(affected_agents_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/AffectedCount.md b/thousandeyes-sdk-event-detection/docs/AffectedCount.md new file mode 100644 index 000000000..b0b9dd581 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/AffectedCount.md @@ -0,0 +1,30 @@ +# AffectedCount + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | The total number affected. | [optional] [readonly] +**in_account_group** | **int** | Indicates if in the affected account group. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.affected_count import AffectedCount + +# TODO update the JSON string below +json = "{}" +# create an instance of AffectedCount from a JSON string +affected_count_instance = AffectedCount.from_json(json) +# print the JSON string representation of the object +print(AffectedCount.to_json()) + +# convert the object into a dict +affected_count_dict = affected_count_instance.to_dict() +# create an instance of AffectedCount from a dict +affected_count_from_dict = AffectedCount.from_dict(affected_count_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/AffectedTargets.md b/thousandeyes-sdk-event-detection/docs/AffectedTargets.md new file mode 100644 index 000000000..703ec214e --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/AffectedTargets.md @@ -0,0 +1,31 @@ +# AffectedTargets + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | The total number affected. | [optional] [readonly] +**in_account_group** | **int** | Indicates if in the affected account group. | [optional] [readonly] +**targets** | [**List[ApiAffectedTarget]**](ApiAffectedTarget.md) | List of affected targets. | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets + +# TODO update the JSON string below +json = "{}" +# create an instance of AffectedTargets from a JSON string +affected_targets_instance = AffectedTargets.from_json(json) +# print the JSON string representation of the object +print(AffectedTargets.to_json()) + +# convert the object into a dict +affected_targets_dict = affected_targets_instance.to_dict() +# create an instance of AffectedTargets from a dict +affected_targets_from_dict = AffectedTargets.from_dict(affected_targets_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/AffectedTests.md b/thousandeyes-sdk-event-detection/docs/AffectedTests.md new file mode 100644 index 000000000..dfd89725a --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/AffectedTests.md @@ -0,0 +1,31 @@ +# AffectedTests + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**total** | **int** | The total number affected. | [optional] [readonly] +**in_account_group** | **int** | Indicates if in the affected account group. | [optional] [readonly] +**tests** | [**List[ApiAffectedTest]**](ApiAffectedTest.md) | List of affected tests. | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests + +# TODO update the JSON string below +json = "{}" +# create an instance of AffectedTests from a JSON string +affected_tests_instance = AffectedTests.from_json(json) +# print the JSON string representation of the object +print(AffectedTests.to_json()) + +# convert the object into a dict +affected_tests_dict = affected_tests_instance.to_dict() +# create an instance of AffectedTests from a dict +affected_tests_from_dict = AffectedTests.from_dict(affected_tests_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/AgentLinks.md b/thousandeyes-sdk-event-detection/docs/AgentLinks.md new file mode 100644 index 000000000..ca345cc7f --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/AgentLinks.md @@ -0,0 +1,30 @@ +# AgentLinks + +A links object containing the agent link. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.agent_links import AgentLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentLinks from a JSON string +agent_links_instance = AgentLinks.from_json(json) +# print the JSON string representation of the object +print(AgentLinks.to_json()) + +# convert the object into a dict +agent_links_dict = agent_links_instance.to_dict() +# create an instance of AgentLinks from a dict +agent_links_from_dict = AgentLinks.from_dict(agent_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/AgentLocalEventDetail.md b/thousandeyes-sdk-event-detection/docs/AgentLocalEventDetail.md new file mode 100644 index 000000000..98c1617c3 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/AgentLocalEventDetail.md @@ -0,0 +1,43 @@ +# AgentLocalEventDetail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each event. | [optional] [readonly] +**type_name** | **str** | Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue. | [optional] [readonly] +**state** | [**EventState**](EventState.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] +**severity** | [**Severity**](Severity.md) | | [optional] +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] +**affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] +**affected_targets** | [**AffectedTargets**](AffectedTargets.md) | | [optional] +**affected_agents** | [**AffectedAgents**](AffectedAgents.md) | | [optional] +**cause** | **List[str]** | The cause of the error. | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] +**type** | **str** | Agent local event type. | +**grouping** | [**AgentLocalEventGrouping**](AgentLocalEventGrouping.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.agent_local_event_detail import AgentLocalEventDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentLocalEventDetail from a JSON string +agent_local_event_detail_instance = AgentLocalEventDetail.from_json(json) +# print the JSON string representation of the object +print(AgentLocalEventDetail.to_json()) + +# convert the object into a dict +agent_local_event_detail_dict = agent_local_event_detail_instance.to_dict() +# create an instance of AgentLocalEventDetail from a dict +agent_local_event_detail_from_dict = AgentLocalEventDetail.from_dict(agent_local_event_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/AgentLocalEventGrouping.md b/thousandeyes-sdk-event-detection/docs/AgentLocalEventGrouping.md new file mode 100644 index 000000000..764adbb20 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/AgentLocalEventGrouping.md @@ -0,0 +1,29 @@ +# AgentLocalEventGrouping + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | Numeric Agent ID (for agent-local events). | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.agent_local_event_grouping import AgentLocalEventGrouping + +# TODO update the JSON string below +json = "{}" +# create an instance of AgentLocalEventGrouping from a JSON string +agent_local_event_grouping_instance = AgentLocalEventGrouping.from_json(json) +# print the JSON string representation of the object +print(AgentLocalEventGrouping.to_json()) + +# convert the object into a dict +agent_local_event_grouping_dict = agent_local_event_grouping_instance.to_dict() +# create an instance of AgentLocalEventGrouping from a dict +agent_local_event_grouping_from_dict = AgentLocalEventGrouping.from_dict(agent_local_event_grouping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/ApiAffectedAgent.md b/thousandeyes-sdk-event-detection/docs/ApiAffectedAgent.md new file mode 100644 index 000000000..e016a3692 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/ApiAffectedAgent.md @@ -0,0 +1,36 @@ +# ApiAffectedAgent + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**agent_id** | **str** | The ID of the virtual agent. | [optional] [readonly] +**type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | [optional] +**name** | **str** | The name of the agent as defined in settings. | [optional] [readonly] +**location** | **str** | The name of the agent's location. | [optional] [readonly] +**country_code** | **str** | The country code of the agent's location . | [optional] [readonly] +**affected_target_ids** | **List[str]** | An array of unique target IDs that contributed data points which generated the signal for the event. | [optional] +**affected_test_ids** | **List[str]** | An array of unique agent IDs that contributed data points which generated the signal for the event. | [optional] +**links** | [**AgentLinks**](AgentLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.api_affected_agent import ApiAffectedAgent + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAffectedAgent from a JSON string +api_affected_agent_instance = ApiAffectedAgent.from_json(json) +# print the JSON string representation of the object +print(ApiAffectedAgent.to_json()) + +# convert the object into a dict +api_affected_agent_dict = api_affected_agent_instance.to_dict() +# create an instance of ApiAffectedAgent from a dict +api_affected_agent_from_dict = ApiAffectedAgent.from_dict(api_affected_agent_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/ApiAffectedTarget.md b/thousandeyes-sdk-event-detection/docs/ApiAffectedTarget.md new file mode 100644 index 000000000..ce480bc99 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/ApiAffectedTarget.md @@ -0,0 +1,33 @@ +# ApiAffectedTarget + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**server_id** | **str** | The ID of the target server. | [optional] [readonly] +**name** | **str** | The target name as configured in the test settings. | [optional] [readonly] +**ip** | **str** | The target server IP resolved by the agent. Depending on the failure type, the IP may not be present. For example, if the agent failed to resolve it or if the requests were routed through the proxy. | [optional] [readonly] +**affected_test_ids** | **List[str]** | An array of unique test IDs that contributed data points which generated the signal for the event. | [optional] +**affected_agent_ids** | **List[str]** | An array of unique agent IDs that contributed data points which generated the signal for the event. | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.api_affected_target import ApiAffectedTarget + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAffectedTarget from a JSON string +api_affected_target_instance = ApiAffectedTarget.from_json(json) +# print the JSON string representation of the object +print(ApiAffectedTarget.to_json()) + +# convert the object into a dict +api_affected_target_dict = api_affected_target_instance.to_dict() +# create an instance of ApiAffectedTarget from a dict +api_affected_target_from_dict = ApiAffectedTarget.from_dict(api_affected_target_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/ApiAffectedTest.md b/thousandeyes-sdk-event-detection/docs/ApiAffectedTest.md new file mode 100644 index 000000000..da70c934f --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/ApiAffectedTest.md @@ -0,0 +1,34 @@ +# ApiAffectedTest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test_id** | **str** | The ID of the affected test. | [optional] [readonly] +**test_type** | [**TestType**](TestType.md) | | [optional] +**name** | **str** | The test name as configured in the test settings. | [optional] [readonly] +**affected_target_ids** | **List[str]** | An array of unique target IDs contributed data points which generated the signal for the event. | [optional] +**affected_agent_ids** | **List[str]** | An array of unique agent IDs that contributed data points which generated the signal for the event. | [optional] +**links** | [**TestLinks**](TestLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.api_affected_test import ApiAffectedTest + +# TODO update the JSON string below +json = "{}" +# create an instance of ApiAffectedTest from a JSON string +api_affected_test_instance = ApiAffectedTest.from_json(json) +# print the JSON string representation of the object +print(ApiAffectedTest.to_json()) + +# convert the object into a dict +api_affected_test_dict = api_affected_test_instance.to_dict() +# create an instance of ApiAffectedTest from a dict +api_affected_test_from_dict = ApiAffectedTest.from_dict(api_affected_test_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/CloudEnterpriseAgentType.md b/thousandeyes-sdk-event-detection/docs/CloudEnterpriseAgentType.md new file mode 100644 index 000000000..371c853b2 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/CloudEnterpriseAgentType.md @@ -0,0 +1,12 @@ +# CloudEnterpriseAgentType + +Type of the agent. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/DnsEventDetail.md b/thousandeyes-sdk-event-detection/docs/DnsEventDetail.md new file mode 100644 index 000000000..5279864fd --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/DnsEventDetail.md @@ -0,0 +1,43 @@ +# DnsEventDetail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each event. | [optional] [readonly] +**type_name** | **str** | Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue. | [optional] [readonly] +**state** | [**EventState**](EventState.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] +**severity** | [**Severity**](Severity.md) | | [optional] +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] +**affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] +**affected_targets** | [**AffectedTargets**](AffectedTargets.md) | | [optional] +**affected_agents** | [**AffectedAgents**](AffectedAgents.md) | | [optional] +**cause** | **List[str]** | The cause of the error. | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] +**type** | **str** | DNS event type. | +**grouping** | [**DnsEventGrouping**](DnsEventGrouping.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.dns_event_detail import DnsEventDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsEventDetail from a JSON string +dns_event_detail_instance = DnsEventDetail.from_json(json) +# print the JSON string representation of the object +print(DnsEventDetail.to_json()) + +# convert the object into a dict +dns_event_detail_dict = dns_event_detail_instance.to_dict() +# create an instance of DnsEventDetail from a dict +dns_event_detail_from_dict = DnsEventDetail.from_dict(dns_event_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/DnsEventGrouping.md b/thousandeyes-sdk-event-detection/docs/DnsEventGrouping.md new file mode 100644 index 000000000..2c7a59fd3 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/DnsEventGrouping.md @@ -0,0 +1,29 @@ +# DnsEventGrouping + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**root_domain** | **str** | Root domain name (for dns events). | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.dns_event_grouping import DnsEventGrouping + +# TODO update the JSON string below +json = "{}" +# create an instance of DnsEventGrouping from a JSON string +dns_event_grouping_instance = DnsEventGrouping.from_json(json) +# print the JSON string representation of the object +print(DnsEventGrouping.to_json()) + +# convert the object into a dict +dns_event_grouping_dict = dns_event_grouping_instance.to_dict() +# create an instance of DnsEventGrouping from a dict +dns_event_grouping_from_dict = DnsEventGrouping.from_dict(dns_event_grouping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/Error.md b/thousandeyes-sdk-event-detection/docs/Error.md new file mode 100644 index 000000000..af1a19211 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/Error.md @@ -0,0 +1,33 @@ +# Error + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.error import Error + +# TODO update the JSON string below +json = "{}" +# create an instance of Error from a JSON string +error_instance = Error.from_json(json) +# print the JSON string representation of the object +print(Error.to_json()) + +# convert the object into a dict +error_dict = error_instance.to_dict() +# create an instance of Error from a dict +error_from_dict = Error.from_dict(error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/Event.md b/thousandeyes-sdk-event-detection/docs/Event.md new file mode 100644 index 000000000..5706da1dc --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/Event.md @@ -0,0 +1,40 @@ +# Event + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each event. | [optional] [readonly] +**type_name** | **str** | Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue. | [optional] [readonly] +**state** | [**EventState**](EventState.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] +**severity** | [**Severity**](Severity.md) | | [optional] +**title** | **str** | Event title | [optional] [readonly] +**type** | [**EventType**](EventType.md) | | [optional] +**affected_tests** | [**AffectedCount**](AffectedCount.md) | | [optional] +**affected_targets** | [**AffectedCount**](AffectedCount.md) | | [optional] +**affected_agents** | [**AffectedCount**](AffectedCount.md) | | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.event import Event + +# TODO update the JSON string below +json = "{}" +# create an instance of Event from a JSON string +event_instance = Event.from_json(json) +# print the JSON string representation of the object +print(Event.to_json()) + +# convert the object into a dict +event_dict = event_instance.to_dict() +# create an instance of Event from a dict +event_from_dict = Event.from_dict(event_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/EventDetail.md b/thousandeyes-sdk-event-detection/docs/EventDetail.md new file mode 100644 index 000000000..7a694fb70 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/EventDetail.md @@ -0,0 +1,43 @@ +# EventDetail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each event. | [optional] [readonly] +**type_name** | **str** | Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue. | [optional] [readonly] +**state** | [**EventState**](EventState.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] +**severity** | [**Severity**](Severity.md) | | [optional] +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] +**affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] +**affected_targets** | [**AffectedTargets**](AffectedTargets.md) | | [optional] +**affected_agents** | [**AffectedAgents**](AffectedAgents.md) | | [optional] +**cause** | **List[str]** | The cause of the error. | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] +**type** | **str** | Network pop event type. | +**grouping** | [**NetworkEventGrouping**](NetworkEventGrouping.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.event_detail import EventDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of EventDetail from a JSON string +event_detail_instance = EventDetail.from_json(json) +# print the JSON string representation of the object +print(EventDetail.to_json()) + +# convert the object into a dict +event_detail_dict = event_detail_instance.to_dict() +# create an instance of EventDetail from a dict +event_detail_from_dict = EventDetail.from_dict(event_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/EventDetailBase.md b/thousandeyes-sdk-event-detection/docs/EventDetailBase.md new file mode 100644 index 000000000..bc884dbf7 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/EventDetailBase.md @@ -0,0 +1,41 @@ +# EventDetailBase + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each event. | [optional] [readonly] +**type_name** | **str** | Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue. | [optional] [readonly] +**state** | [**EventState**](EventState.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] +**severity** | [**Severity**](Severity.md) | | [optional] +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] +**affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] +**affected_targets** | [**AffectedTargets**](AffectedTargets.md) | | [optional] +**affected_agents** | [**AffectedAgents**](AffectedAgents.md) | | [optional] +**cause** | **List[str]** | The cause of the error. | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.event_detail_base import EventDetailBase + +# TODO update the JSON string below +json = "{}" +# create an instance of EventDetailBase from a JSON string +event_detail_base_instance = EventDetailBase.from_json(json) +# print the JSON string representation of the object +print(EventDetailBase.to_json()) + +# convert the object into a dict +event_detail_base_dict = event_detail_base_instance.to_dict() +# create an instance of EventDetailBase from a dict +event_detail_base_from_dict = EventDetailBase.from_dict(event_detail_base_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/EventState.md b/thousandeyes-sdk-event-detection/docs/EventState.md new file mode 100644 index 000000000..f6971f3ed --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/EventState.md @@ -0,0 +1,12 @@ +# EventState + +Indicates the state of the event, whether it is ongoing (active) or has been resolved. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/EventType.md b/thousandeyes-sdk-event-detection/docs/EventType.md new file mode 100644 index 000000000..6550e3618 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/EventType.md @@ -0,0 +1,12 @@ +# EventType + +Specifies the event type in a machine-readable and backwards-compatible format. Allowed values are: `agent-local`, `network-pop`, `network`, `dns`, `target`, and `proxy`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/Events.md b/thousandeyes-sdk-event-detection/docs/Events.md new file mode 100644 index 000000000..b944a277a --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/Events.md @@ -0,0 +1,33 @@ +# Events + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**start_date** | **datetime** | (Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**end_date** | **datetime** | (Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format). | [optional] [readonly] +**events** | [**List[Event]**](Event.md) | | [optional] +**links** | [**PaginationNextAndSelfLinks**](PaginationNextAndSelfLinks.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.events import Events + +# TODO update the JSON string below +json = "{}" +# create an instance of Events from a JSON string +events_instance = Events.from_json(json) +# print the JSON string representation of the object +print(Events.to_json()) + +# convert the object into a dict +events_dict = events_instance.to_dict() +# create an instance of Events from a dict +events_from_dict = Events.from_dict(events_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/EventsApi.md b/thousandeyes-sdk-event-detection/docs/EventsApi.md new file mode 100644 index 000000000..eb8c0d6d0 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/EventsApi.md @@ -0,0 +1,193 @@ +# thousandeyes_sdk.event_detection.EventsApi + +All URIs are relative to *https://api.thousandeyes.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_event**](EventsApi.md#get_event) | **GET** /v7/events/{id} | Retrieve event +[**get_events**](EventsApi.md#get_events) | **GET** /v7/events | List events + + +# **get_event** +> EventDetail get_event(id, aid=aid) + +Retrieve event + +Returns detailed information about an event using its ID. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.event_detection +from thousandeyes_sdk.event_detection.models.event_detail import EventDetail +from thousandeyes_sdk.event_detection.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 = thousandeyes_sdk.core.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 = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.event_detection.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.event_detection.EventsApi(api_client) + id = 'e9c3bf02-a48c-4aa8-9e5f-898800d6f569' # str | Unique event ID. + aid = '1234' # 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: + # Retrieve event + api_response = api_instance.get_event(id, aid=aid) + print("The response of EventsApi->get_event:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->get_event: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **id** | **str**| Unique event ID. | + **aid** | **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] + +### Return type + +[**EventDetail**](EventDetail.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_events** +> Events get_events(aid=aid, window=window, start_date=start_date, end_date=end_date, max=max, cursor=cursor) + +List events + +Retrieves a list of events within the specified time window. If no events are active during the specified time range, an empty response is returned. **Note**: You must provide either a time window using the `window` parameter or specify `startDate` and `endDate`. + +### Example + +* Bearer Authentication (BearerAuth): + +```python +import thousandeyes_sdk.event_detection +from thousandeyes_sdk.event_detection.models.events import Events +from thousandeyes_sdk.event_detection.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 = thousandeyes_sdk.core.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 = thousandeyes_sdk.core.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# Enter a context with an instance of the API client +with thousandeyes_sdk.event_detection.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = thousandeyes_sdk.event_detection.EventsApi(api_client) + aid = '1234' # 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) + window = '12h' # str | A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. (optional) + start_date = '2022-07-17T22:00:54Z' # datetime | Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + end_date = '2022-07-18T22:00:54Z' # datetime | Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. (optional) + max = 5 # int | (Optional) Maximum number of objects to return. (optional) + cursor = 'cursor_example' # str | (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. (optional) + + try: + # List events + api_response = api_instance.get_events(aid=aid, window=window, start_date=start_date, end_date=end_date, max=max, cursor=cursor) + print("The response of EventsApi->get_events:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling EventsApi->get_events: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **aid** | **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] + **window** | **str**| A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. | [optional] + **start_date** | **datetime**| Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **end_date** | **datetime**| Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. | [optional] + **max** | **int**| (Optional) Maximum number of objects to return. | [optional] + **cursor** | **str**| (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. | [optional] + +### Return type + +[**Events**](Events.md) + +### Authorization + +[BearerAuth](../README.md#BearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/hal+json, application/json, application/problem+json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK | - | +**400** | Bad Request | - | +**401** | Unauthorized | - | +**403** | Insufficient permissions to query endpoint | - | +**404** | Not found | - | +**429** | Exhausted rate limit for the organization | - | +**500** | Internal server error | - | +**502** | Bad Gateway | - | +**0** | An error occurred | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/thousandeyes-sdk-event-detection/docs/Link.md b/thousandeyes-sdk-event-detection/docs/Link.md new file mode 100644 index 000000000..42016cdc6 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/Link.md @@ -0,0 +1,37 @@ +# Link + +A hyperlink from the containing resource to a URI. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**href** | **str** | Its value is either a URI [RFC3986] or a URI template [RFC6570]. | +**templated** | **bool** | Should be true when the link object's \"href\" property is a URI template. | [optional] +**type** | **str** | Used as a hint to indicate the media type expected when dereferencing the target resource. | [optional] +**deprecation** | **str** | Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation. | [optional] +**name** | **str** | Its value may be used as a secondary key for selecting link objects that share the same relation type. | [optional] +**profile** | **str** | A URI that hints about the profile of the target resource. | [optional] +**title** | **str** | Intended for labelling the link with a human-readable identifier | [optional] +**hreflang** | **str** | Indicates the language of the target resource | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.link import Link + +# TODO update the JSON string below +json = "{}" +# create an instance of Link from a JSON string +link_instance = Link.from_json(json) +# print the JSON string representation of the object +print(Link.to_json()) + +# convert the object into a dict +link_dict = link_instance.to_dict() +# create an instance of Link from a dict +link_from_dict = Link.from_dict(link_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/NetworkEventDetail.md b/thousandeyes-sdk-event-detection/docs/NetworkEventDetail.md new file mode 100644 index 000000000..c55786d28 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/NetworkEventDetail.md @@ -0,0 +1,43 @@ +# NetworkEventDetail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each event. | [optional] [readonly] +**type_name** | **str** | Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue. | [optional] [readonly] +**state** | [**EventState**](EventState.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] +**severity** | [**Severity**](Severity.md) | | [optional] +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] +**affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] +**affected_targets** | [**AffectedTargets**](AffectedTargets.md) | | [optional] +**affected_agents** | [**AffectedAgents**](AffectedAgents.md) | | [optional] +**cause** | **List[str]** | The cause of the error. | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] +**type** | **str** | Network event type. | +**grouping** | [**NetworkEventGrouping**](NetworkEventGrouping.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.network_event_detail import NetworkEventDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkEventDetail from a JSON string +network_event_detail_instance = NetworkEventDetail.from_json(json) +# print the JSON string representation of the object +print(NetworkEventDetail.to_json()) + +# convert the object into a dict +network_event_detail_dict = network_event_detail_instance.to_dict() +# create an instance of NetworkEventDetail from a dict +network_event_detail_from_dict = NetworkEventDetail.from_dict(network_event_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/NetworkEventGrouping.md b/thousandeyes-sdk-event-detection/docs/NetworkEventGrouping.md new file mode 100644 index 000000000..d92f8a15b --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/NetworkEventGrouping.md @@ -0,0 +1,31 @@ +# NetworkEventGrouping + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**source_asn** | **int** | AS number of the source network (for network-pop and network events). | [optional] [readonly] +**dest_asn** | **int** | AS number of the destination network (for network events). | [optional] [readonly] +**source_country_code** | **str** | The source network's country code (for network-pop and network events). | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.network_event_grouping import NetworkEventGrouping + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkEventGrouping from a JSON string +network_event_grouping_instance = NetworkEventGrouping.from_json(json) +# print the JSON string representation of the object +print(NetworkEventGrouping.to_json()) + +# convert the object into a dict +network_event_grouping_dict = network_event_grouping_instance.to_dict() +# create an instance of NetworkEventGrouping from a dict +network_event_grouping_from_dict = NetworkEventGrouping.from_dict(network_event_grouping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/NetworkPopEventDetail.md b/thousandeyes-sdk-event-detection/docs/NetworkPopEventDetail.md new file mode 100644 index 000000000..4ee74e868 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/NetworkPopEventDetail.md @@ -0,0 +1,43 @@ +# NetworkPopEventDetail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each event. | [optional] [readonly] +**type_name** | **str** | Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue. | [optional] [readonly] +**state** | [**EventState**](EventState.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] +**severity** | [**Severity**](Severity.md) | | [optional] +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] +**affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] +**affected_targets** | [**AffectedTargets**](AffectedTargets.md) | | [optional] +**affected_agents** | [**AffectedAgents**](AffectedAgents.md) | | [optional] +**cause** | **List[str]** | The cause of the error. | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] +**type** | **str** | Network pop event type. | +**grouping** | [**NetworkEventGrouping**](NetworkEventGrouping.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.network_pop_event_detail import NetworkPopEventDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of NetworkPopEventDetail from a JSON string +network_pop_event_detail_instance = NetworkPopEventDetail.from_json(json) +# print the JSON string representation of the object +print(NetworkPopEventDetail.to_json()) + +# convert the object into a dict +network_pop_event_detail_dict = network_pop_event_detail_instance.to_dict() +# create an instance of NetworkPopEventDetail from a dict +network_pop_event_detail_from_dict = NetworkPopEventDetail.from_dict(network_pop_event_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/PaginationNextAndSelfLinks.md b/thousandeyes-sdk-event-detection/docs/PaginationNextAndSelfLinks.md new file mode 100644 index 000000000..5bde23bd2 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/PaginationNextAndSelfLinks.md @@ -0,0 +1,31 @@ +# PaginationNextAndSelfLinks + +A links object containing pagination-related links, including only next and self. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**next** | [**Link**](Link.md) | | [optional] +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.pagination_next_and_self_links import PaginationNextAndSelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of PaginationNextAndSelfLinks from a JSON string +pagination_next_and_self_links_instance = PaginationNextAndSelfLinks.from_json(json) +# print the JSON string representation of the object +print(PaginationNextAndSelfLinks.to_json()) + +# convert the object into a dict +pagination_next_and_self_links_dict = pagination_next_and_self_links_instance.to_dict() +# create an instance of PaginationNextAndSelfLinks from a dict +pagination_next_and_self_links_from_dict = PaginationNextAndSelfLinks.from_dict(pagination_next_and_self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/ProxyEventDetail.md b/thousandeyes-sdk-event-detection/docs/ProxyEventDetail.md new file mode 100644 index 000000000..79da16d32 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/ProxyEventDetail.md @@ -0,0 +1,43 @@ +# ProxyEventDetail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each event. | [optional] [readonly] +**type_name** | **str** | Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue. | [optional] [readonly] +**state** | [**EventState**](EventState.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] +**severity** | [**Severity**](Severity.md) | | [optional] +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] +**affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] +**affected_targets** | [**AffectedTargets**](AffectedTargets.md) | | [optional] +**affected_agents** | [**AffectedAgents**](AffectedAgents.md) | | [optional] +**cause** | **List[str]** | The cause of the error. | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] +**type** | **str** | Proxy event type. | +**grouping** | [**ProxyEventGrouping**](ProxyEventGrouping.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.proxy_event_detail import ProxyEventDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of ProxyEventDetail from a JSON string +proxy_event_detail_instance = ProxyEventDetail.from_json(json) +# print the JSON string representation of the object +print(ProxyEventDetail.to_json()) + +# convert the object into a dict +proxy_event_detail_dict = proxy_event_detail_instance.to_dict() +# create an instance of ProxyEventDetail from a dict +proxy_event_detail_from_dict = ProxyEventDetail.from_dict(proxy_event_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/ProxyEventGrouping.md b/thousandeyes-sdk-event-detection/docs/ProxyEventGrouping.md new file mode 100644 index 000000000..6989b7b33 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/ProxyEventGrouping.md @@ -0,0 +1,29 @@ +# ProxyEventGrouping + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**proxy** | **str** | Proxy name or IP (for proxy events). | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.proxy_event_grouping import ProxyEventGrouping + +# TODO update the JSON string below +json = "{}" +# create an instance of ProxyEventGrouping from a JSON string +proxy_event_grouping_instance = ProxyEventGrouping.from_json(json) +# print the JSON string representation of the object +print(ProxyEventGrouping.to_json()) + +# convert the object into a dict +proxy_event_grouping_dict = proxy_event_grouping_instance.to_dict() +# create an instance of ProxyEventGrouping from a dict +proxy_event_grouping_from_dict = ProxyEventGrouping.from_dict(proxy_event_grouping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/SelfLinks.md b/thousandeyes-sdk-event-detection/docs/SelfLinks.md new file mode 100644 index 000000000..5ba030cdc --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/SelfLinks.md @@ -0,0 +1,30 @@ +# SelfLinks + +A links object containing the self link. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**var_self** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of SelfLinks from a JSON string +self_links_instance = SelfLinks.from_json(json) +# print the JSON string representation of the object +print(SelfLinks.to_json()) + +# convert the object into a dict +self_links_dict = self_links_instance.to_dict() +# create an instance of SelfLinks from a dict +self_links_from_dict = SelfLinks.from_dict(self_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/Severity.md b/thousandeyes-sdk-event-detection/docs/Severity.md new file mode 100644 index 000000000..3abd8037d --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/Severity.md @@ -0,0 +1,12 @@ +# Severity + +The severity of the alert. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/SimpleEventDetail.md b/thousandeyes-sdk-event-detection/docs/SimpleEventDetail.md new file mode 100644 index 000000000..a2c399075 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/SimpleEventDetail.md @@ -0,0 +1,34 @@ +# SimpleEventDetail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each event. | [optional] [readonly] +**type_name** | **str** | Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue. | [optional] [readonly] +**state** | [**EventState**](EventState.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] +**severity** | [**Severity**](Severity.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.simple_event_detail import SimpleEventDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of SimpleEventDetail from a JSON string +simple_event_detail_instance = SimpleEventDetail.from_json(json) +# print the JSON string representation of the object +print(SimpleEventDetail.to_json()) + +# convert the object into a dict +simple_event_detail_dict = simple_event_detail_instance.to_dict() +# create an instance of SimpleEventDetail from a dict +simple_event_detail_from_dict = SimpleEventDetail.from_dict(simple_event_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/TargetEventDetail.md b/thousandeyes-sdk-event-detection/docs/TargetEventDetail.md new file mode 100644 index 000000000..984f9b8fd --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/TargetEventDetail.md @@ -0,0 +1,43 @@ +# TargetEventDetail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each event. | [optional] [readonly] +**type_name** | **str** | Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue. | [optional] [readonly] +**state** | [**EventState**](EventState.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] +**severity** | [**Severity**](Severity.md) | | [optional] +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] +**affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] +**affected_targets** | [**AffectedTargets**](AffectedTargets.md) | | [optional] +**affected_agents** | [**AffectedAgents**](AffectedAgents.md) | | [optional] +**cause** | **List[str]** | The cause of the error. | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] +**type** | **str** | Target event type. | +**grouping** | [**TargetEventGrouping**](TargetEventGrouping.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.target_event_detail import TargetEventDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of TargetEventDetail from a JSON string +target_event_detail_instance = TargetEventDetail.from_json(json) +# print the JSON string representation of the object +print(TargetEventDetail.to_json()) + +# convert the object into a dict +target_event_detail_dict = target_event_detail_instance.to_dict() +# create an instance of TargetEventDetail from a dict +target_event_detail_from_dict = TargetEventDetail.from_dict(target_event_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/TargetEventGrouping.md b/thousandeyes-sdk-event-detection/docs/TargetEventGrouping.md new file mode 100644 index 000000000..772ea5a77 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/TargetEventGrouping.md @@ -0,0 +1,29 @@ +# TargetEventGrouping + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**target** | **str** | Target name (for target events). | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.target_event_grouping import TargetEventGrouping + +# TODO update the JSON string below +json = "{}" +# create an instance of TargetEventGrouping from a JSON string +target_event_grouping_instance = TargetEventGrouping.from_json(json) +# print the JSON string representation of the object +print(TargetEventGrouping.to_json()) + +# convert the object into a dict +target_event_grouping_dict = target_event_grouping_instance.to_dict() +# create an instance of TargetEventGrouping from a dict +target_event_grouping_from_dict = TargetEventGrouping.from_dict(target_event_grouping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/TargetNetworkEventDetail.md b/thousandeyes-sdk-event-detection/docs/TargetNetworkEventDetail.md new file mode 100644 index 000000000..3d385ed98 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/TargetNetworkEventDetail.md @@ -0,0 +1,43 @@ +# TargetNetworkEventDetail + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | A unique ID for each event. | [optional] [readonly] +**type_name** | **str** | Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue. | [optional] [readonly] +**state** | [**EventState**](EventState.md) | | [optional] +**start_date** | **datetime** | The start date and time (in UTC, ISO 8601 format) when the event was first detected. | [optional] [readonly] +**end_date** | **datetime** | The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events. | [optional] [readonly] +**severity** | [**Severity**](Severity.md) | | [optional] +**aid** | **str** | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. | [optional] +**summary** | **str** | A brief summary describing the cause of the event. | [optional] [readonly] +**affected_tests** | [**AffectedTests**](AffectedTests.md) | | [optional] +**affected_targets** | [**AffectedTargets**](AffectedTargets.md) | | [optional] +**affected_agents** | [**AffectedAgents**](AffectedAgents.md) | | [optional] +**cause** | **List[str]** | The cause of the error. | [optional] +**links** | [**SelfLinks**](SelfLinks.md) | | [optional] +**type** | **str** | Target network event type. | +**grouping** | [**TargetNetworkEventGrouping**](TargetNetworkEventGrouping.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.target_network_event_detail import TargetNetworkEventDetail + +# TODO update the JSON string below +json = "{}" +# create an instance of TargetNetworkEventDetail from a JSON string +target_network_event_detail_instance = TargetNetworkEventDetail.from_json(json) +# print the JSON string representation of the object +print(TargetNetworkEventDetail.to_json()) + +# convert the object into a dict +target_network_event_detail_dict = target_network_event_detail_instance.to_dict() +# create an instance of TargetNetworkEventDetail from a dict +target_network_event_detail_from_dict = TargetNetworkEventDetail.from_dict(target_network_event_detail_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/TargetNetworkEventGrouping.md b/thousandeyes-sdk-event-detection/docs/TargetNetworkEventGrouping.md new file mode 100644 index 000000000..4ed7aea02 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/TargetNetworkEventGrouping.md @@ -0,0 +1,29 @@ +# TargetNetworkEventGrouping + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**prefix** | **str** | Prefix value for target-network events. | [optional] [readonly] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.target_network_event_grouping import TargetNetworkEventGrouping + +# TODO update the JSON string below +json = "{}" +# create an instance of TargetNetworkEventGrouping from a JSON string +target_network_event_grouping_instance = TargetNetworkEventGrouping.from_json(json) +# print the JSON string representation of the object +print(TargetNetworkEventGrouping.to_json()) + +# convert the object into a dict +target_network_event_grouping_dict = target_network_event_grouping_instance.to_dict() +# create an instance of TargetNetworkEventGrouping from a dict +target_network_event_grouping_from_dict = TargetNetworkEventGrouping.from_dict(target_network_event_grouping_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/TestLinks.md b/thousandeyes-sdk-event-detection/docs/TestLinks.md new file mode 100644 index 000000000..31618210f --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/TestLinks.md @@ -0,0 +1,30 @@ +# TestLinks + +A links object containing the self link. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**test** | [**Link**](Link.md) | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.test_links import TestLinks + +# TODO update the JSON string below +json = "{}" +# create an instance of TestLinks from a JSON string +test_links_instance = TestLinks.from_json(json) +# print the JSON string representation of the object +print(TestLinks.to_json()) + +# convert the object into a dict +test_links_dict = test_links_instance.to_dict() +# create an instance of TestLinks from a dict +test_links_from_dict = TestLinks.from_dict(test_links_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/TestType.md b/thousandeyes-sdk-event-detection/docs/TestType.md new file mode 100644 index 000000000..8093a7394 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/TestType.md @@ -0,0 +1,12 @@ +# TestType + +This is a read only value, as test type is implicit in the test creation url. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/UnauthorizedError.md b/thousandeyes-sdk-event-detection/docs/UnauthorizedError.md new file mode 100644 index 000000000..13e91f6c9 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/UnauthorizedError.md @@ -0,0 +1,30 @@ +# UnauthorizedError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | | [optional] +**error_description** | **str** | | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.unauthorized_error import UnauthorizedError + +# TODO update the JSON string below +json = "{}" +# create an instance of UnauthorizedError from a JSON string +unauthorized_error_instance = UnauthorizedError.from_json(json) +# print the JSON string representation of the object +print(UnauthorizedError.to_json()) + +# convert the object into a dict +unauthorized_error_dict = unauthorized_error_instance.to_dict() +# create an instance of UnauthorizedError from a dict +unauthorized_error_from_dict = UnauthorizedError.from_dict(unauthorized_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/ValidationError.md b/thousandeyes-sdk-event-detection/docs/ValidationError.md new file mode 100644 index 000000000..ac2be2007 --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/ValidationError.md @@ -0,0 +1,34 @@ +# ValidationError + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\". | [optional] +**title** | **str** | A short, human-readable summary of the problem type. | [optional] +**status** | **int** | The HTTP status code generated by the origin server for this occurrence of the problem. | [optional] +**detail** | **str** | A human-readable explanation specific to this occurrence of the problem. | [optional] +**instance** | **str** | A URI reference that identifies the specific occurrence of the problem. | [optional] +**errors** | [**List[ValidationErrorItem]**](ValidationErrorItem.md) | (Optional) When multiple errors occur, the details for each error are listed. | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.validation_error import ValidationError + +# TODO update the JSON string below +json = "{}" +# create an instance of ValidationError from a JSON string +validation_error_instance = ValidationError.from_json(json) +# print the JSON string representation of the object +print(ValidationError.to_json()) + +# convert the object into a dict +validation_error_dict = validation_error_instance.to_dict() +# create an instance of ValidationError from a dict +validation_error_from_dict = ValidationError.from_dict(validation_error_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/docs/ValidationErrorItem.md b/thousandeyes-sdk-event-detection/docs/ValidationErrorItem.md new file mode 100644 index 000000000..d0267958f --- /dev/null +++ b/thousandeyes-sdk-event-detection/docs/ValidationErrorItem.md @@ -0,0 +1,31 @@ +# ValidationErrorItem + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | (Optional) A unique error type/code that can be referenced in the documentation for further details. | [optional] +**var_field** | **str** | Identifies the field that triggered this particular error. | [optional] +**message** | **str** | A short, human-readable summary of the error. | [optional] + +## Example + +```python +from thousandeyes_sdk.event_detection.models.validation_error_item import ValidationErrorItem + +# TODO update the JSON string below +json = "{}" +# create an instance of ValidationErrorItem from a JSON string +validation_error_item_instance = ValidationErrorItem.from_json(json) +# print the JSON string representation of the object +print(ValidationErrorItem.to_json()) + +# convert the object into a dict +validation_error_item_dict = validation_error_item_instance.to_dict() +# create an instance of ValidationErrorItem from a dict +validation_error_item_from_dict = ValidationErrorItem.from_dict(validation_error_item_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/thousandeyes-sdk-event-detection/pyproject.toml b/thousandeyes-sdk-event-detection/pyproject.toml new file mode 100644 index 000000000..2a9cc4d7e --- /dev/null +++ b/thousandeyes-sdk-event-detection/pyproject.toml @@ -0,0 +1,82 @@ +[project] +name = "thousandeyes-sdk-event-detection" +dynamic = ["version"] +readme = "README.md" +authors = [ + { name = "ThousandEyes API Team", email = "api-team@thousandeyes.com" } +] +description = "ThousandEyes SDK Event Detection API" +license = { file = "LICENSE" } +requires-python = ">= 3.8" +dependencies = [ + "urllib3 >= 1.25.3", + "python-dateutil >=2.8.2", + "pydantic >=2", + "typing-extensions >=4.7.1", + "thousandeyes-sdk-core", +] + +[tool.setuptools.dynamic] +version = {file = ".version"} + +[project.optional-dependencies] +test = [ + "pytest~=7.1.3", + "pytest-cov>=2.8.1", + "pytest-randomly>=3.12.0", + "mypy>=1.4.1", + "types-python-dateutil>=2.8.19", +] +dev = [ + "flake8>=4.0.0", + "mypy>=1.4.1", + "types-python-dateutil>=2.8.19", +] + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +include-package-data = true + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "src", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +strict_concatenate = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true diff --git a/thousandeyes-sdk-event-detection/setup.cfg b/thousandeyes-sdk-event-detection/setup.cfg new file mode 100644 index 000000000..11433ee87 --- /dev/null +++ b/thousandeyes-sdk-event-detection/setup.cfg @@ -0,0 +1,2 @@ +[flake8] +max-line-length=99 diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/__init__.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/__init__.py new file mode 100644 index 000000000..5d821f9f3 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/__init__.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import apis into sdk package +from thousandeyes_sdk.event_detection.api.events_api import EventsApi + + +# import models into sdk package +from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents +from thousandeyes_sdk.event_detection.models.affected_count import AffectedCount +from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets +from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.agent_links import AgentLinks +from thousandeyes_sdk.event_detection.models.agent_local_event_detail import AgentLocalEventDetail +from thousandeyes_sdk.event_detection.models.agent_local_event_grouping import AgentLocalEventGrouping +from thousandeyes_sdk.event_detection.models.api_affected_agent import ApiAffectedAgent +from thousandeyes_sdk.event_detection.models.api_affected_target import ApiAffectedTarget +from thousandeyes_sdk.event_detection.models.api_affected_test import ApiAffectedTest +from thousandeyes_sdk.event_detection.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from thousandeyes_sdk.event_detection.models.dns_event_detail import DnsEventDetail +from thousandeyes_sdk.event_detection.models.dns_event_grouping import DnsEventGrouping +from thousandeyes_sdk.event_detection.models.error import Error +from thousandeyes_sdk.event_detection.models.event import Event +from thousandeyes_sdk.event_detection.models.event_detail import EventDetail +from thousandeyes_sdk.event_detection.models.event_detail_base import EventDetailBase +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.event_type import EventType +from thousandeyes_sdk.event_detection.models.events import Events +from thousandeyes_sdk.event_detection.models.link import Link +from thousandeyes_sdk.event_detection.models.network_event_detail import NetworkEventDetail +from thousandeyes_sdk.event_detection.models.network_event_grouping import NetworkEventGrouping +from thousandeyes_sdk.event_detection.models.network_pop_event_detail import NetworkPopEventDetail +from thousandeyes_sdk.event_detection.models.pagination_next_and_self_links import PaginationNextAndSelfLinks +from thousandeyes_sdk.event_detection.models.proxy_event_detail import ProxyEventDetail +from thousandeyes_sdk.event_detection.models.proxy_event_grouping import ProxyEventGrouping +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks +from thousandeyes_sdk.event_detection.models.severity import Severity +from thousandeyes_sdk.event_detection.models.simple_event_detail import SimpleEventDetail +from thousandeyes_sdk.event_detection.models.target_event_detail import TargetEventDetail +from thousandeyes_sdk.event_detection.models.target_event_grouping import TargetEventGrouping +from thousandeyes_sdk.event_detection.models.target_network_event_detail import TargetNetworkEventDetail +from thousandeyes_sdk.event_detection.models.target_network_event_grouping import TargetNetworkEventGrouping +from thousandeyes_sdk.event_detection.models.test_links import TestLinks +from thousandeyes_sdk.event_detection.models.test_type import TestType +from thousandeyes_sdk.event_detection.models.unauthorized_error import UnauthorizedError +from thousandeyes_sdk.event_detection.models.validation_error import ValidationError +from thousandeyes_sdk.event_detection.models.validation_error_item import ValidationErrorItem diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/api/__init__.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/api/__init__.py new file mode 100644 index 000000000..3b2b7dbee --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/api/__init__.py @@ -0,0 +1,5 @@ +# flake8: noqa + +# import apis into api package +from thousandeyes_sdk.event_detection.api.events_api import EventsApi + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/api/events_api.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/api/events_api.py new file mode 100644 index 000000000..581dd6208 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/api/events_api.py @@ -0,0 +1,729 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated +from importlib.metadata import version + +import thousandeyes_sdk.event_detection.models + +from datetime import datetime +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import Optional +from typing_extensions import Annotated +from thousandeyes_sdk.event_detection.models.event_detail import EventDetail +from thousandeyes_sdk.event_detection.models.events import Events + +from thousandeyes_sdk.core.api_client import ApiClient, RequestSerialized +from thousandeyes_sdk.core.api_response import ApiResponse +from thousandeyes_sdk.core.rest import RESTResponseType + + +class EventsApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + api_client.user_agent = "ThousandEyesSDK-Python/{0}".format(version("thousandeyes-sdk-event-detection")) + self.api_client = api_client + + + @validate_call + def get_event( + self, + id: Annotated[StrictStr, Field(description="Unique event ID.")], + aid: Annotated[Optional[StrictStr], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EventDetail: + """Retrieve event + + Returns detailed information about an event using its ID. + + :param id: Unique event ID. (required) + :type id: str + :param aid: 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. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_event_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventDetail", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.event_detection.models, + ).data + + + @validate_call + def get_event_with_http_info( + self, + id: Annotated[StrictStr, Field(description="Unique event ID.")], + aid: Annotated[Optional[StrictStr], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EventDetail]: + """Retrieve event + + Returns detailed information about an event using its ID. + + :param id: Unique event ID. (required) + :type id: str + :param aid: 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. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_event_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventDetail", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.event_detection.models, + ) + + + @validate_call + def get_event_without_preload_content( + self, + id: Annotated[StrictStr, Field(description="Unique event ID.")], + aid: Annotated[Optional[StrictStr], Field(description="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.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve event + + Returns detailed information about an event using its ID. + + :param id: Unique event ID. (required) + :type id: str + :param aid: 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. + :type aid: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_event_serialize( + id=id, + aid=aid, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventDetail", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_event_serialize( + self, + id, + aid, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if id is not None: + _path_params['id'] = id + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/events/{id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_events( + self, + aid: Annotated[Optional[StrictStr], Field(description="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.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Events: + """List events + + Retrieves a list of events within the specified time window. If no events are active during the specified time range, an empty response is returned. **Note**: You must provide either a time window using the `window` parameter or specify `startDate` and `endDate`. + + :param aid: 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. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_events_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Events", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.event_detection.models, + ).data + + + @validate_call + def get_events_with_http_info( + self, + aid: Annotated[Optional[StrictStr], Field(description="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.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Events]: + """List events + + Retrieves a list of events within the specified time window. If no events are active during the specified time range, an empty response is returned. **Note**: You must provide either a time window using the `window` parameter or specify `startDate` and `endDate`. + + :param aid: 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. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_events_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Events", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + models=thousandeyes_sdk.event_detection.models, + ) + + + @validate_call + def get_events_without_preload_content( + self, + aid: Annotated[Optional[StrictStr], Field(description="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.")] = None, + window: Annotated[Optional[Annotated[str, Field(strict=True)]], Field(description="A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`.")] = None, + start_date: Annotated[Optional[datetime], Field(description="Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + end_date: Annotated[Optional[datetime], Field(description="Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`.")] = None, + max: Annotated[Optional[StrictInt], Field(description="(Optional) Maximum number of objects to return.")] = None, + cursor: Annotated[Optional[StrictStr], Field(description="(Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List events + + Retrieves a list of events within the specified time window. If no events are active during the specified time range, an empty response is returned. **Note**: You must provide either a time window using the `window` parameter or specify `startDate` and `endDate`. + + :param aid: 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. + :type aid: str + :param window: A dynamic time interval up to the current time of the request. Specify the interval as a number followed by an optional type: `s` for seconds (default if no type is specified), `m` for minutes, `h` for hours, `d` for days, and `w` for weeks. For a precise date range, use `startDate` and `endDate`. + :type window: str + :param start_date: Use with the `endDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type start_date: datetime + :param end_date: Defaults to current time the request is made. Use with the `startDate` parameter. Include the complete time (hours, minutes, and seconds) in UTC time zone, following the ISO 8601 date-time format. See the example for reference. Please note that this parameter can't be used with `window`. + :type end_date: datetime + :param max: (Optional) Maximum number of objects to return. + :type max: int + :param cursor: (Optional) Opaque cursor used for pagination. Clients should use `next` value from `_links` instead of this parameter. + :type cursor: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_events_serialize( + aid=aid, + window=window, + start_date=start_date, + end_date=end_date, + max=max, + cursor=cursor, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Events", + '400': "ValidationError", + '401': "UnauthorizedError", + '403': "Error", + '404': "Error", + '429': "Error", + '500': "Error", + '502': "Error", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_events_serialize( + self, + aid, + window, + start_date, + end_date, + max, + cursor, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if aid is not None: + + _query_params.append(('aid', aid)) + + if window is not None: + + _query_params.append(('window', window)) + + if start_date is not None: + if isinstance(start_date, datetime): + _query_params.append( + ( + 'startDate', + start_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('startDate', start_date)) + + if end_date is not None: + if isinstance(end_date, datetime): + _query_params.append( + ( + 'endDate', + end_date.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('endDate', end_date)) + + if max is not None: + + _query_params.append(('max', max)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/hal+json', + 'application/json', + 'application/problem+json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'BearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v7/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/__init__.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/__init__.py new file mode 100644 index 000000000..80cab6b61 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/__init__.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +# flake8: noqa +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +# import models into model package +from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents +from thousandeyes_sdk.event_detection.models.affected_count import AffectedCount +from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets +from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.agent_links import AgentLinks +from thousandeyes_sdk.event_detection.models.agent_local_event_detail import AgentLocalEventDetail +from thousandeyes_sdk.event_detection.models.agent_local_event_grouping import AgentLocalEventGrouping +from thousandeyes_sdk.event_detection.models.api_affected_agent import ApiAffectedAgent +from thousandeyes_sdk.event_detection.models.api_affected_target import ApiAffectedTarget +from thousandeyes_sdk.event_detection.models.api_affected_test import ApiAffectedTest +from thousandeyes_sdk.event_detection.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from thousandeyes_sdk.event_detection.models.dns_event_detail import DnsEventDetail +from thousandeyes_sdk.event_detection.models.dns_event_grouping import DnsEventGrouping +from thousandeyes_sdk.event_detection.models.error import Error +from thousandeyes_sdk.event_detection.models.event import Event +from thousandeyes_sdk.event_detection.models.event_detail import EventDetail +from thousandeyes_sdk.event_detection.models.event_detail_base import EventDetailBase +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.event_type import EventType +from thousandeyes_sdk.event_detection.models.events import Events +from thousandeyes_sdk.event_detection.models.link import Link +from thousandeyes_sdk.event_detection.models.network_event_detail import NetworkEventDetail +from thousandeyes_sdk.event_detection.models.network_event_grouping import NetworkEventGrouping +from thousandeyes_sdk.event_detection.models.network_pop_event_detail import NetworkPopEventDetail +from thousandeyes_sdk.event_detection.models.pagination_next_and_self_links import PaginationNextAndSelfLinks +from thousandeyes_sdk.event_detection.models.proxy_event_detail import ProxyEventDetail +from thousandeyes_sdk.event_detection.models.proxy_event_grouping import ProxyEventGrouping +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks +from thousandeyes_sdk.event_detection.models.severity import Severity +from thousandeyes_sdk.event_detection.models.simple_event_detail import SimpleEventDetail +from thousandeyes_sdk.event_detection.models.target_event_detail import TargetEventDetail +from thousandeyes_sdk.event_detection.models.target_event_grouping import TargetEventGrouping +from thousandeyes_sdk.event_detection.models.target_network_event_detail import TargetNetworkEventDetail +from thousandeyes_sdk.event_detection.models.target_network_event_grouping import TargetNetworkEventGrouping +from thousandeyes_sdk.event_detection.models.test_links import TestLinks +from thousandeyes_sdk.event_detection.models.test_type import TestType +from thousandeyes_sdk.event_detection.models.unauthorized_error import UnauthorizedError +from thousandeyes_sdk.event_detection.models.validation_error import ValidationError +from thousandeyes_sdk.event_detection.models.validation_error_item import ValidationErrorItem diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_agents.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_agents.py new file mode 100644 index 000000000..2f1df7bc8 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_agents.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.api_affected_agent import ApiAffectedAgent +from typing import Optional, Set +from typing_extensions import Self + +class AffectedAgents(BaseModel): + """ + AffectedAgents + """ # noqa: E501 + total: Optional[StrictInt] = Field(default=None, description="The total number affected.") + in_account_group: Optional[StrictInt] = Field(default=None, description="Indicates if in the affected account group.", alias="inAccountGroup") + agents: Optional[List[ApiAffectedAgent]] = Field(default=None, description="List of affected agents.") + __properties: ClassVar[List[str]] = ["total", "inAccountGroup", "agents"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AffectedAgents from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "total", + "in_account_group", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in agents (list) + _items = [] + if self.agents: + for _item in self.agents: + if _item: + _items.append(_item.to_dict()) + _dict['agents'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AffectedAgents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "inAccountGroup": obj.get("inAccountGroup"), + "agents": [ApiAffectedAgent.from_dict(_item) for _item in obj["agents"]] if obj.get("agents") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_count.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_count.py new file mode 100644 index 000000000..2a3d9ea20 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_count.py @@ -0,0 +1,93 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AffectedCount(BaseModel): + """ + AffectedCount + """ # noqa: E501 + total: Optional[StrictInt] = Field(default=None, description="The total number affected.") + in_account_group: Optional[StrictInt] = Field(default=None, description="Indicates if in the affected account group.", alias="inAccountGroup") + __properties: ClassVar[List[str]] = ["total", "inAccountGroup"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AffectedCount from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "total", + "in_account_group", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AffectedCount from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "inAccountGroup": obj.get("inAccountGroup") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_targets.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_targets.py new file mode 100644 index 000000000..94e4f8afa --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_targets.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.api_affected_target import ApiAffectedTarget +from typing import Optional, Set +from typing_extensions import Self + +class AffectedTargets(BaseModel): + """ + AffectedTargets + """ # noqa: E501 + total: Optional[StrictInt] = Field(default=None, description="The total number affected.") + in_account_group: Optional[StrictInt] = Field(default=None, description="Indicates if in the affected account group.", alias="inAccountGroup") + targets: Optional[List[ApiAffectedTarget]] = Field(default=None, description="List of affected targets.") + __properties: ClassVar[List[str]] = ["total", "inAccountGroup", "targets"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AffectedTargets from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "total", + "in_account_group", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in targets (list) + _items = [] + if self.targets: + for _item in self.targets: + if _item: + _items.append(_item.to_dict()) + _dict['targets'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AffectedTargets from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "inAccountGroup": obj.get("inAccountGroup"), + "targets": [ApiAffectedTarget.from_dict(_item) for _item in obj["targets"]] if obj.get("targets") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_tests.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_tests.py new file mode 100644 index 000000000..96bb31d3c --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/affected_tests.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.api_affected_test import ApiAffectedTest +from typing import Optional, Set +from typing_extensions import Self + +class AffectedTests(BaseModel): + """ + AffectedTests + """ # noqa: E501 + total: Optional[StrictInt] = Field(default=None, description="The total number affected.") + in_account_group: Optional[StrictInt] = Field(default=None, description="Indicates if in the affected account group.", alias="inAccountGroup") + tests: Optional[List[ApiAffectedTest]] = Field(default=None, description="List of affected tests.") + __properties: ClassVar[List[str]] = ["total", "inAccountGroup", "tests"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AffectedTests from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "total", + "in_account_group", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in tests (list) + _items = [] + if self.tests: + for _item in self.tests: + if _item: + _items.append(_item.to_dict()) + _dict['tests'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AffectedTests from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "inAccountGroup": obj.get("inAccountGroup"), + "tests": [ApiAffectedTest.from_dict(_item) for _item in obj["tests"]] if obj.get("tests") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_links.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_links.py new file mode 100644 index 000000000..bf6afe915 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_links.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class AgentLinks(BaseModel): + """ + A links object containing the agent link. + """ # noqa: E501 + agent: Optional[Link] = None + __properties: ClassVar[List[str]] = ["agent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentLinks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of agent + if self.agent: + _dict['agent'] = self.agent.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agent": Link.from_dict(obj["agent"]) if obj.get("agent") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_detail.py new file mode 100644 index 000000000..391de1fe0 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_detail.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents +from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets +from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.agent_local_event_grouping import AgentLocalEventGrouping +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks +from thousandeyes_sdk.event_detection.models.severity import Severity +from typing import Optional, Set +from typing_extensions import Self + +class AgentLocalEventDetail(BaseModel): + """ + AgentLocalEventDetail + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each event.") + type_name: Optional[StrictStr] = Field(default=None, description="Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue.", alias="typeName") + state: Optional[EventState] = None + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") + severity: Optional[Severity] = None + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") + affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") + affected_targets: Optional[AffectedTargets] = Field(default=None, alias="affectedTargets") + affected_agents: Optional[AffectedAgents] = Field(default=None, alias="affectedAgents") + cause: Optional[List[StrictStr]] = Field(default=None, description="The cause of the error.") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + type: Annotated[str, Field(strict=True)] = Field(description="Agent local event type.") + grouping: Optional[AgentLocalEventGrouping] = None + __properties: ClassVar[List[str]] = ["id", "typeName", "state", "startDate", "endDate", "severity", "aid", "summary", "affectedTests", "affectedTargets", "affectedAgents", "cause", "_links", "type", "grouping"] + + @field_validator('type') + def type_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^agent-local$", value): + raise ValueError(r"must validate the regular expression /^agent-local$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentLocalEventDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "type_name", + "start_date", + "end_date", + "summary", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of affected_tests + if self.affected_tests: + _dict['affectedTests'] = self.affected_tests.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_targets + if self.affected_targets: + _dict['affectedTargets'] = self.affected_targets.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_agents + if self.affected_agents: + _dict['affectedAgents'] = self.affected_agents.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of grouping + if self.grouping: + _dict['grouping'] = self.grouping.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentLocalEventDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "typeName": obj.get("typeName"), + "state": obj.get("state"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "severity": obj.get("severity"), + "aid": obj.get("aid"), + "summary": obj.get("summary"), + "affectedTests": AffectedTests.from_dict(obj["affectedTests"]) if obj.get("affectedTests") is not None else None, + "affectedTargets": AffectedTargets.from_dict(obj["affectedTargets"]) if obj.get("affectedTargets") is not None else None, + "affectedAgents": AffectedAgents.from_dict(obj["affectedAgents"]) if obj.get("affectedAgents") is not None else None, + "cause": obj.get("cause"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "type": obj.get("type"), + "grouping": AgentLocalEventGrouping.from_dict(obj["grouping"]) if obj.get("grouping") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_grouping.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_grouping.py new file mode 100644 index 000000000..4dabec0ff --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/agent_local_event_grouping.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class AgentLocalEventGrouping(BaseModel): + """ + AgentLocalEventGrouping + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="Numeric Agent ID (for agent-local events).", alias="agentId") + __properties: ClassVar[List[str]] = ["agentId"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AgentLocalEventGrouping from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "agent_id", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AgentLocalEventGrouping from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_agent.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_agent.py new file mode 100644 index 000000000..7a690d211 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_agent.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.agent_links import AgentLinks +from thousandeyes_sdk.event_detection.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType +from typing import Optional, Set +from typing_extensions import Self + +class ApiAffectedAgent(BaseModel): + """ + ApiAffectedAgent + """ # noqa: E501 + agent_id: Optional[StrictStr] = Field(default=None, description="The ID of the virtual agent.", alias="agentId") + type: Optional[CloudEnterpriseAgentType] = None + name: Optional[StrictStr] = Field(default=None, description="The name of the agent as defined in settings.") + location: Optional[StrictStr] = Field(default=None, description="The name of the agent's location.") + country_code: Optional[StrictStr] = Field(default=None, description="The country code of the agent's location .", alias="countryCode") + affected_target_ids: Optional[List[StrictStr]] = Field(default=None, description="An array of unique target IDs that contributed data points which generated the signal for the event.", alias="affectedTargetIds") + affected_test_ids: Optional[List[StrictStr]] = Field(default=None, description="An array of unique agent IDs that contributed data points which generated the signal for the event.", alias="affectedTestIds") + links: Optional[AgentLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["agentId", "type", "name", "location", "countryCode", "affectedTargetIds", "affectedTestIds", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAffectedAgent from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "agent_id", + "name", + "location", + "country_code", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAffectedAgent from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "agentId": obj.get("agentId"), + "type": obj.get("type"), + "name": obj.get("name"), + "location": obj.get("location"), + "countryCode": obj.get("countryCode"), + "affectedTargetIds": obj.get("affectedTargetIds"), + "affectedTestIds": obj.get("affectedTestIds"), + "_links": AgentLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_target.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_target.py new file mode 100644 index 000000000..1758bb1de --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_target.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ApiAffectedTarget(BaseModel): + """ + ApiAffectedTarget + """ # noqa: E501 + server_id: Optional[StrictStr] = Field(default=None, description="The ID of the target server.", alias="serverId") + name: Optional[StrictStr] = Field(default=None, description="The target name as configured in the test settings.") + ip: Optional[StrictStr] = Field(default=None, description="The target server IP resolved by the agent. Depending on the failure type, the IP may not be present. For example, if the agent failed to resolve it or if the requests were routed through the proxy.") + affected_test_ids: Optional[List[StrictStr]] = Field(default=None, description="An array of unique test IDs that contributed data points which generated the signal for the event.", alias="affectedTestIds") + affected_agent_ids: Optional[List[StrictStr]] = Field(default=None, description="An array of unique agent IDs that contributed data points which generated the signal for the event.", alias="affectedAgentIds") + __properties: ClassVar[List[str]] = ["serverId", "name", "ip", "affectedTestIds", "affectedAgentIds"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAffectedTarget from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "server_id", + "name", + "ip", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAffectedTarget from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "serverId": obj.get("serverId"), + "name": obj.get("name"), + "ip": obj.get("ip"), + "affectedTestIds": obj.get("affectedTestIds"), + "affectedAgentIds": obj.get("affectedAgentIds") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_test.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_test.py new file mode 100644 index 000000000..a21a27afa --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/api_affected_test.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.test_links import TestLinks +from thousandeyes_sdk.event_detection.models.test_type import TestType +from typing import Optional, Set +from typing_extensions import Self + +class ApiAffectedTest(BaseModel): + """ + ApiAffectedTest + """ # noqa: E501 + test_id: Optional[StrictStr] = Field(default=None, description="The ID of the affected test.", alias="testId") + test_type: Optional[TestType] = Field(default=None, alias="testType") + name: Optional[StrictStr] = Field(default=None, description="The test name as configured in the test settings.") + affected_target_ids: Optional[List[StrictStr]] = Field(default=None, description="An array of unique target IDs contributed data points which generated the signal for the event.", alias="affectedTargetIds") + affected_agent_ids: Optional[List[StrictStr]] = Field(default=None, description="An array of unique agent IDs that contributed data points which generated the signal for the event.", alias="affectedAgentIds") + links: Optional[TestLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["testId", "testType", "name", "affectedTargetIds", "affectedAgentIds", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAffectedTest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "test_id", + "name", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAffectedTest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "testId": obj.get("testId"), + "testType": obj.get("testType"), + "name": obj.get("name"), + "affectedTargetIds": obj.get("affectedTargetIds"), + "affectedAgentIds": obj.get("affectedAgentIds"), + "_links": TestLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/cloud_enterprise_agent_type.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/cloud_enterprise_agent_type.py new file mode 100644 index 000000000..165837656 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/cloud_enterprise_agent_type.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class CloudEnterpriseAgentType(str, Enum): + """ + Type of the agent. + """ + + """ + allowed enum values + """ + CLOUD = 'cloud' + ENTERPRISE_MINUS_CLUSTER = 'enterprise-cluster' + ENTERPRISE = 'enterprise' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CloudEnterpriseAgentType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_detail.py new file mode 100644 index 000000000..9a006e600 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_detail.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents +from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets +from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.dns_event_grouping import DnsEventGrouping +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks +from thousandeyes_sdk.event_detection.models.severity import Severity +from typing import Optional, Set +from typing_extensions import Self + +class DnsEventDetail(BaseModel): + """ + DnsEventDetail + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each event.") + type_name: Optional[StrictStr] = Field(default=None, description="Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue.", alias="typeName") + state: Optional[EventState] = None + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") + severity: Optional[Severity] = None + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") + affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") + affected_targets: Optional[AffectedTargets] = Field(default=None, alias="affectedTargets") + affected_agents: Optional[AffectedAgents] = Field(default=None, alias="affectedAgents") + cause: Optional[List[StrictStr]] = Field(default=None, description="The cause of the error.") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + type: Annotated[str, Field(strict=True)] = Field(description="DNS event type.") + grouping: Optional[DnsEventGrouping] = None + __properties: ClassVar[List[str]] = ["id", "typeName", "state", "startDate", "endDate", "severity", "aid", "summary", "affectedTests", "affectedTargets", "affectedAgents", "cause", "_links", "type", "grouping"] + + @field_validator('type') + def type_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^dns$", value): + raise ValueError(r"must validate the regular expression /^dns$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsEventDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "type_name", + "start_date", + "end_date", + "summary", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of affected_tests + if self.affected_tests: + _dict['affectedTests'] = self.affected_tests.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_targets + if self.affected_targets: + _dict['affectedTargets'] = self.affected_targets.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_agents + if self.affected_agents: + _dict['affectedAgents'] = self.affected_agents.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of grouping + if self.grouping: + _dict['grouping'] = self.grouping.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsEventDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "typeName": obj.get("typeName"), + "state": obj.get("state"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "severity": obj.get("severity"), + "aid": obj.get("aid"), + "summary": obj.get("summary"), + "affectedTests": AffectedTests.from_dict(obj["affectedTests"]) if obj.get("affectedTests") is not None else None, + "affectedTargets": AffectedTargets.from_dict(obj["affectedTargets"]) if obj.get("affectedTargets") is not None else None, + "affectedAgents": AffectedAgents.from_dict(obj["affectedAgents"]) if obj.get("affectedAgents") is not None else None, + "cause": obj.get("cause"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "type": obj.get("type"), + "grouping": DnsEventGrouping.from_dict(obj["grouping"]) if obj.get("grouping") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_grouping.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_grouping.py new file mode 100644 index 000000000..dc29be18a --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/dns_event_grouping.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class DnsEventGrouping(BaseModel): + """ + DnsEventGrouping + """ # noqa: E501 + root_domain: Optional[StrictStr] = Field(default=None, description="Root domain name (for dns events).", alias="rootDomain") + __properties: ClassVar[List[str]] = ["rootDomain"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of DnsEventGrouping from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "root_domain", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of DnsEventGrouping from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "rootDomain": obj.get("rootDomain") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/error.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/error.py new file mode 100644 index 000000000..b2a22889a --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/error.py @@ -0,0 +1,95 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Error(BaseModel): + """ + Error + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\".") + title: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the problem type.") + status: Optional[StrictInt] = Field(default=None, description="The HTTP status code generated by the origin server for this occurrence of the problem.") + detail: Optional[StrictStr] = Field(default=None, description="A human-readable explanation specific to this occurrence of the problem.") + instance: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the specific occurrence of the problem.") + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Error from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Error from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "status": obj.get("status"), + "detail": obj.get("detail"), + "instance": obj.get("instance") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event.py new file mode 100644 index 000000000..b287d8265 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event.py @@ -0,0 +1,137 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.affected_count import AffectedCount +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.event_type import EventType +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks +from thousandeyes_sdk.event_detection.models.severity import Severity +from typing import Optional, Set +from typing_extensions import Self + +class Event(BaseModel): + """ + Event + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each event.") + type_name: Optional[StrictStr] = Field(default=None, description="Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue.", alias="typeName") + state: Optional[EventState] = None + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") + severity: Optional[Severity] = None + title: Optional[StrictStr] = Field(default=None, description="Event title") + type: Optional[EventType] = None + affected_tests: Optional[AffectedCount] = Field(default=None, alias="affectedTests") + affected_targets: Optional[AffectedCount] = Field(default=None, alias="affectedTargets") + affected_agents: Optional[AffectedCount] = Field(default=None, alias="affectedAgents") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "typeName", "state", "startDate", "endDate", "severity", "title", "type", "affectedTests", "affectedTargets", "affectedAgents", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Event from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "type_name", + "start_date", + "end_date", + "title", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of affected_tests + if self.affected_tests: + _dict['affectedTests'] = self.affected_tests.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_targets + if self.affected_targets: + _dict['affectedTargets'] = self.affected_targets.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_agents + if self.affected_agents: + _dict['affectedAgents'] = self.affected_agents.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Event from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "typeName": obj.get("typeName"), + "state": obj.get("state"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "severity": obj.get("severity"), + "title": obj.get("title"), + "type": obj.get("type"), + "affectedTests": AffectedCount.from_dict(obj["affectedTests"]) if obj.get("affectedTests") is not None else None, + "affectedTargets": AffectedCount.from_dict(obj["affectedTargets"]) if obj.get("affectedTargets") is not None else None, + "affectedAgents": AffectedCount.from_dict(obj["affectedAgents"]) if obj.get("affectedAgents") is not None else None, + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail.py new file mode 100644 index 000000000..b18b8cd52 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail.py @@ -0,0 +1,213 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from thousandeyes_sdk.event_detection.models.agent_local_event_detail import AgentLocalEventDetail +from thousandeyes_sdk.event_detection.models.dns_event_detail import DnsEventDetail +from thousandeyes_sdk.event_detection.models.network_event_detail import NetworkEventDetail +from thousandeyes_sdk.event_detection.models.network_pop_event_detail import NetworkPopEventDetail +from thousandeyes_sdk.event_detection.models.proxy_event_detail import ProxyEventDetail +from thousandeyes_sdk.event_detection.models.target_event_detail import TargetEventDetail +from thousandeyes_sdk.event_detection.models.target_network_event_detail import TargetNetworkEventDetail +from pydantic import StrictStr, Field, model_serializer +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +EVENTDETAIL_ONE_OF_SCHEMAS = ["AgentLocalEventDetail", "DnsEventDetail", "NetworkEventDetail", "NetworkPopEventDetail", "ProxyEventDetail", "TargetEventDetail", "TargetNetworkEventDetail"] + +class EventDetail(BaseModel): + """ + EventDetail + """ + # data type: TargetEventDetail + oneof_schema_1_validator: Optional[TargetEventDetail] = None + # data type: TargetNetworkEventDetail + oneof_schema_2_validator: Optional[TargetNetworkEventDetail] = None + # data type: ProxyEventDetail + oneof_schema_3_validator: Optional[ProxyEventDetail] = None + # data type: DnsEventDetail + oneof_schema_4_validator: Optional[DnsEventDetail] = None + # data type: AgentLocalEventDetail + oneof_schema_5_validator: Optional[AgentLocalEventDetail] = None + # data type: NetworkEventDetail + oneof_schema_6_validator: Optional[NetworkEventDetail] = None + # data type: NetworkPopEventDetail + oneof_schema_7_validator: Optional[NetworkPopEventDetail] = None + actual_instance: Optional[Union[AgentLocalEventDetail, DnsEventDetail, NetworkEventDetail, NetworkPopEventDetail, ProxyEventDetail, TargetEventDetail, TargetNetworkEventDetail]] = None + one_of_schemas: Set[str] = { "AgentLocalEventDetail", "DnsEventDetail", "NetworkEventDetail", "NetworkPopEventDetail", "ProxyEventDetail", "TargetEventDetail", "TargetNetworkEventDetail" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = EventDetail.model_construct() + error_messages = [] + match = 0 + # validate data type: TargetEventDetail + if not isinstance(v, TargetEventDetail): + error_messages.append(f"Error! Input type `{type(v)}` is not `TargetEventDetail`") + else: + match += 1 + # validate data type: TargetNetworkEventDetail + if not isinstance(v, TargetNetworkEventDetail): + error_messages.append(f"Error! Input type `{type(v)}` is not `TargetNetworkEventDetail`") + else: + match += 1 + # validate data type: ProxyEventDetail + if not isinstance(v, ProxyEventDetail): + error_messages.append(f"Error! Input type `{type(v)}` is not `ProxyEventDetail`") + else: + match += 1 + # validate data type: DnsEventDetail + if not isinstance(v, DnsEventDetail): + error_messages.append(f"Error! Input type `{type(v)}` is not `DnsEventDetail`") + else: + match += 1 + # validate data type: AgentLocalEventDetail + if not isinstance(v, AgentLocalEventDetail): + error_messages.append(f"Error! Input type `{type(v)}` is not `AgentLocalEventDetail`") + else: + match += 1 + # validate data type: NetworkEventDetail + if not isinstance(v, NetworkEventDetail): + error_messages.append(f"Error! Input type `{type(v)}` is not `NetworkEventDetail`") + else: + match += 1 + # validate data type: NetworkPopEventDetail + if not isinstance(v, NetworkPopEventDetail): + error_messages.append(f"Error! Input type `{type(v)}` is not `NetworkPopEventDetail`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in EventDetail with oneOf schemas: AgentLocalEventDetail, DnsEventDetail, NetworkEventDetail, NetworkPopEventDetail, ProxyEventDetail, TargetEventDetail, TargetNetworkEventDetail. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in EventDetail with oneOf schemas: AgentLocalEventDetail, DnsEventDetail, NetworkEventDetail, NetworkPopEventDetail, ProxyEventDetail, TargetEventDetail, TargetNetworkEventDetail. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into TargetEventDetail + try: + instance.actual_instance = TargetEventDetail.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into TargetNetworkEventDetail + try: + instance.actual_instance = TargetNetworkEventDetail.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ProxyEventDetail + try: + instance.actual_instance = ProxyEventDetail.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into DnsEventDetail + try: + instance.actual_instance = DnsEventDetail.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AgentLocalEventDetail + try: + instance.actual_instance = AgentLocalEventDetail.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into NetworkEventDetail + try: + instance.actual_instance = NetworkEventDetail.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into NetworkPopEventDetail + try: + instance.actual_instance = NetworkPopEventDetail.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into EventDetail with oneOf schemas: AgentLocalEventDetail, DnsEventDetail, NetworkEventDetail, NetworkPopEventDetail, ProxyEventDetail, TargetEventDetail, TargetNetworkEventDetail. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into EventDetail with oneOf schemas: AgentLocalEventDetail, DnsEventDetail, NetworkEventDetail, NetworkPopEventDetail, ProxyEventDetail, TargetEventDetail, TargetNetworkEventDetail. Details: " + ", ".join(error_messages)) + else: + return instance + + @model_serializer(when_used="json") + def serialize_model(self): + return json.loads(self.to_json()) + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AgentLocalEventDetail, DnsEventDetail, NetworkEventDetail, NetworkPopEventDetail, ProxyEventDetail, TargetEventDetail, TargetNetworkEventDetail]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail_base.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail_base.py new file mode 100644 index 000000000..caa1cd307 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_detail_base.py @@ -0,0 +1,140 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents +from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets +from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks +from thousandeyes_sdk.event_detection.models.severity import Severity +from typing import Optional, Set +from typing_extensions import Self + +class EventDetailBase(BaseModel): + """ + EventDetailBase + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each event.") + type_name: Optional[StrictStr] = Field(default=None, description="Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue.", alias="typeName") + state: Optional[EventState] = None + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") + severity: Optional[Severity] = None + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") + affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") + affected_targets: Optional[AffectedTargets] = Field(default=None, alias="affectedTargets") + affected_agents: Optional[AffectedAgents] = Field(default=None, alias="affectedAgents") + cause: Optional[List[StrictStr]] = Field(default=None, description="The cause of the error.") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["id", "typeName", "state", "startDate", "endDate", "severity", "aid", "summary", "affectedTests", "affectedTargets", "affectedAgents", "cause", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventDetailBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "type_name", + "start_date", + "end_date", + "summary", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of affected_tests + if self.affected_tests: + _dict['affectedTests'] = self.affected_tests.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_targets + if self.affected_targets: + _dict['affectedTargets'] = self.affected_targets.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_agents + if self.affected_agents: + _dict['affectedAgents'] = self.affected_agents.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventDetailBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "typeName": obj.get("typeName"), + "state": obj.get("state"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "severity": obj.get("severity"), + "aid": obj.get("aid"), + "summary": obj.get("summary"), + "affectedTests": AffectedTests.from_dict(obj["affectedTests"]) if obj.get("affectedTests") is not None else None, + "affectedTargets": AffectedTargets.from_dict(obj["affectedTargets"]) if obj.get("affectedTargets") is not None else None, + "affectedAgents": AffectedAgents.from_dict(obj["affectedAgents"]) if obj.get("affectedAgents") is not None else None, + "cause": obj.get("cause"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_state.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_state.py new file mode 100644 index 000000000..e19ab4526 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_state.py @@ -0,0 +1,36 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EventState(str, Enum): + """ + Indicates the state of the event, whether it is ongoing (active) or has been resolved. + """ + + """ + allowed enum values + """ + ACTIVE = 'active' + RESOLVED = 'resolved' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EventState from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_type.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_type.py new file mode 100644 index 000000000..141422d77 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/event_type.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EventType(str, Enum): + """ + Specifies the event type in a machine-readable and backwards-compatible format. Allowed values are: `agent-local`, `network-pop`, `network`, `dns`, `target`, and `proxy`. + """ + + """ + allowed enum values + """ + AGENT_MINUS_LOCAL = 'agent-local' + NETWORK_MINUS_POP = 'network-pop' + NETWORK = 'network' + DNS = 'dns' + TARGET = 'target' + TARGET_MINUS_NETWORK = 'target-network' + PROXY = 'proxy' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EventType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/events.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/events.py new file mode 100644 index 000000000..afbc80422 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/events.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.event import Event +from thousandeyes_sdk.event_detection.models.pagination_next_and_self_links import PaginationNextAndSelfLinks +from typing import Optional, Set +from typing_extensions import Self + +class Events(BaseModel): + """ + Events + """ # noqa: E501 + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + start_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `startDate` parameter, the client will also receive the `startDate` field indicating the UTC start date of the data's time range being retrieved (ISO date-time format).", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="(Optional) When passing `window` or `endDate` parameter, the client will also receive the `endDate` field indicating the UTC end date of the data's time range being retrieved (ISO date-time format).", alias="endDate") + events: Optional[List[Event]] = None + links: Optional[PaginationNextAndSelfLinks] = Field(default=None, alias="_links") + __properties: ClassVar[List[str]] = ["aid", "startDate", "endDate", "events", "_links"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Events from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in events (list) + _items = [] + if self.events: + for _item in self.events: + if _item: + _items.append(_item.to_dict()) + _dict['events'] = _items + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Events from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aid": obj.get("aid"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "events": [Event.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "_links": PaginationNextAndSelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/link.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/link.py new file mode 100644 index 000000000..55f53be5e --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/link.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Link(BaseModel): + """ + A hyperlink from the containing resource to a URI. + """ # noqa: E501 + href: StrictStr = Field(description="Its value is either a URI [RFC3986] or a URI template [RFC6570].") + templated: Optional[StrictBool] = Field(default=None, description="Should be true when the link object's \"href\" property is a URI template.") + type: Optional[StrictStr] = Field(default=None, description="Used as a hint to indicate the media type expected when dereferencing the target resource.") + deprecation: Optional[StrictStr] = Field(default=None, description="Its presence indicates that the link is to be deprecated at a future date. Its value is a URL that should provide further information about the deprecation.") + name: Optional[StrictStr] = Field(default=None, description="Its value may be used as a secondary key for selecting link objects that share the same relation type.") + profile: Optional[StrictStr] = Field(default=None, description="A URI that hints about the profile of the target resource.") + title: Optional[StrictStr] = Field(default=None, description="Intended for labelling the link with a human-readable identifier") + hreflang: Optional[StrictStr] = Field(default=None, description="Indicates the language of the target resource") + __properties: ClassVar[List[str]] = ["href", "templated", "type", "deprecation", "name", "profile", "title", "hreflang"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Link from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Link from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "href": obj.get("href"), + "templated": obj.get("templated"), + "type": obj.get("type"), + "deprecation": obj.get("deprecation"), + "name": obj.get("name"), + "profile": obj.get("profile"), + "title": obj.get("title"), + "hreflang": obj.get("hreflang") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_detail.py new file mode 100644 index 000000000..7f71acb7b --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_detail.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents +from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets +from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.network_event_grouping import NetworkEventGrouping +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks +from thousandeyes_sdk.event_detection.models.severity import Severity +from typing import Optional, Set +from typing_extensions import Self + +class NetworkEventDetail(BaseModel): + """ + NetworkEventDetail + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each event.") + type_name: Optional[StrictStr] = Field(default=None, description="Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue.", alias="typeName") + state: Optional[EventState] = None + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") + severity: Optional[Severity] = None + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") + affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") + affected_targets: Optional[AffectedTargets] = Field(default=None, alias="affectedTargets") + affected_agents: Optional[AffectedAgents] = Field(default=None, alias="affectedAgents") + cause: Optional[List[StrictStr]] = Field(default=None, description="The cause of the error.") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + type: Annotated[str, Field(strict=True)] = Field(description="Network event type.") + grouping: Optional[NetworkEventGrouping] = None + __properties: ClassVar[List[str]] = ["id", "typeName", "state", "startDate", "endDate", "severity", "aid", "summary", "affectedTests", "affectedTargets", "affectedAgents", "cause", "_links", "type", "grouping"] + + @field_validator('type') + def type_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^network$", value): + raise ValueError(r"must validate the regular expression /^network$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NetworkEventDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "type_name", + "start_date", + "end_date", + "summary", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of affected_tests + if self.affected_tests: + _dict['affectedTests'] = self.affected_tests.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_targets + if self.affected_targets: + _dict['affectedTargets'] = self.affected_targets.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_agents + if self.affected_agents: + _dict['affectedAgents'] = self.affected_agents.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of grouping + if self.grouping: + _dict['grouping'] = self.grouping.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NetworkEventDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "typeName": obj.get("typeName"), + "state": obj.get("state"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "severity": obj.get("severity"), + "aid": obj.get("aid"), + "summary": obj.get("summary"), + "affectedTests": AffectedTests.from_dict(obj["affectedTests"]) if obj.get("affectedTests") is not None else None, + "affectedTargets": AffectedTargets.from_dict(obj["affectedTargets"]) if obj.get("affectedTargets") is not None else None, + "affectedAgents": AffectedAgents.from_dict(obj["affectedAgents"]) if obj.get("affectedAgents") is not None else None, + "cause": obj.get("cause"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "type": obj.get("type"), + "grouping": NetworkEventGrouping.from_dict(obj["grouping"]) if obj.get("grouping") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_grouping.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_grouping.py new file mode 100644 index 000000000..872337482 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_event_grouping.py @@ -0,0 +1,97 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class NetworkEventGrouping(BaseModel): + """ + NetworkEventGrouping + """ # noqa: E501 + source_asn: Optional[StrictInt] = Field(default=None, description="AS number of the source network (for network-pop and network events).", alias="sourceAsn") + dest_asn: Optional[StrictInt] = Field(default=None, description="AS number of the destination network (for network events).", alias="destAsn") + source_country_code: Optional[StrictStr] = Field(default=None, description="The source network's country code (for network-pop and network events).", alias="sourceCountryCode") + __properties: ClassVar[List[str]] = ["sourceAsn", "destAsn", "sourceCountryCode"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NetworkEventGrouping from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "source_asn", + "dest_asn", + "source_country_code", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NetworkEventGrouping from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sourceAsn": obj.get("sourceAsn"), + "destAsn": obj.get("destAsn"), + "sourceCountryCode": obj.get("sourceCountryCode") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_pop_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_pop_event_detail.py new file mode 100644 index 000000000..651232564 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/network_pop_event_detail.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents +from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets +from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.network_event_grouping import NetworkEventGrouping +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks +from thousandeyes_sdk.event_detection.models.severity import Severity +from typing import Optional, Set +from typing_extensions import Self + +class NetworkPopEventDetail(BaseModel): + """ + NetworkPopEventDetail + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each event.") + type_name: Optional[StrictStr] = Field(default=None, description="Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue.", alias="typeName") + state: Optional[EventState] = None + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") + severity: Optional[Severity] = None + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") + affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") + affected_targets: Optional[AffectedTargets] = Field(default=None, alias="affectedTargets") + affected_agents: Optional[AffectedAgents] = Field(default=None, alias="affectedAgents") + cause: Optional[List[StrictStr]] = Field(default=None, description="The cause of the error.") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + type: Annotated[str, Field(strict=True)] = Field(description="Network pop event type.") + grouping: Optional[NetworkEventGrouping] = None + __properties: ClassVar[List[str]] = ["id", "typeName", "state", "startDate", "endDate", "severity", "aid", "summary", "affectedTests", "affectedTargets", "affectedAgents", "cause", "_links", "type", "grouping"] + + @field_validator('type') + def type_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^network-pop$", value): + raise ValueError(r"must validate the regular expression /^network-pop$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of NetworkPopEventDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "type_name", + "start_date", + "end_date", + "summary", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of affected_tests + if self.affected_tests: + _dict['affectedTests'] = self.affected_tests.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_targets + if self.affected_targets: + _dict['affectedTargets'] = self.affected_targets.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_agents + if self.affected_agents: + _dict['affectedAgents'] = self.affected_agents.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of grouping + if self.grouping: + _dict['grouping'] = self.grouping.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of NetworkPopEventDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "typeName": obj.get("typeName"), + "state": obj.get("state"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "severity": obj.get("severity"), + "aid": obj.get("aid"), + "summary": obj.get("summary"), + "affectedTests": AffectedTests.from_dict(obj["affectedTests"]) if obj.get("affectedTests") is not None else None, + "affectedTargets": AffectedTargets.from_dict(obj["affectedTargets"]) if obj.get("affectedTargets") is not None else None, + "affectedAgents": AffectedAgents.from_dict(obj["affectedAgents"]) if obj.get("affectedAgents") is not None else None, + "cause": obj.get("cause"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "type": obj.get("type"), + "grouping": NetworkEventGrouping.from_dict(obj["grouping"]) if obj.get("grouping") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/pagination_next_and_self_links.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/pagination_next_and_self_links.py new file mode 100644 index 000000000..4faaf2fbf --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/pagination_next_and_self_links.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class PaginationNextAndSelfLinks(BaseModel): + """ + A links object containing pagination-related links, including only next and self. + """ # noqa: E501 + next: Optional[Link] = None + var_self: Optional[Link] = Field(default=None, alias="self") + __properties: ClassVar[List[str]] = ["next", "self"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PaginationNextAndSelfLinks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of next + if self.next: + _dict['next'] = self.next.to_dict() + # override the default output from pydantic by calling `to_dict()` of var_self + if self.var_self: + _dict['self'] = self.var_self.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PaginationNextAndSelfLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "next": Link.from_dict(obj["next"]) if obj.get("next") is not None else None, + "self": Link.from_dict(obj["self"]) if obj.get("self") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_detail.py new file mode 100644 index 000000000..d8f7f70bc --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_detail.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents +from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets +from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.proxy_event_grouping import ProxyEventGrouping +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks +from thousandeyes_sdk.event_detection.models.severity import Severity +from typing import Optional, Set +from typing_extensions import Self + +class ProxyEventDetail(BaseModel): + """ + ProxyEventDetail + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each event.") + type_name: Optional[StrictStr] = Field(default=None, description="Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue.", alias="typeName") + state: Optional[EventState] = None + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") + severity: Optional[Severity] = None + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") + affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") + affected_targets: Optional[AffectedTargets] = Field(default=None, alias="affectedTargets") + affected_agents: Optional[AffectedAgents] = Field(default=None, alias="affectedAgents") + cause: Optional[List[StrictStr]] = Field(default=None, description="The cause of the error.") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + type: Annotated[str, Field(strict=True)] = Field(description="Proxy event type.") + grouping: Optional[ProxyEventGrouping] = None + __properties: ClassVar[List[str]] = ["id", "typeName", "state", "startDate", "endDate", "severity", "aid", "summary", "affectedTests", "affectedTargets", "affectedAgents", "cause", "_links", "type", "grouping"] + + @field_validator('type') + def type_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^proxy$", value): + raise ValueError(r"must validate the regular expression /^proxy$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProxyEventDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "type_name", + "start_date", + "end_date", + "summary", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of affected_tests + if self.affected_tests: + _dict['affectedTests'] = self.affected_tests.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_targets + if self.affected_targets: + _dict['affectedTargets'] = self.affected_targets.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_agents + if self.affected_agents: + _dict['affectedAgents'] = self.affected_agents.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of grouping + if self.grouping: + _dict['grouping'] = self.grouping.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProxyEventDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "typeName": obj.get("typeName"), + "state": obj.get("state"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "severity": obj.get("severity"), + "aid": obj.get("aid"), + "summary": obj.get("summary"), + "affectedTests": AffectedTests.from_dict(obj["affectedTests"]) if obj.get("affectedTests") is not None else None, + "affectedTargets": AffectedTargets.from_dict(obj["affectedTargets"]) if obj.get("affectedTargets") is not None else None, + "affectedAgents": AffectedAgents.from_dict(obj["affectedAgents"]) if obj.get("affectedAgents") is not None else None, + "cause": obj.get("cause"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "type": obj.get("type"), + "grouping": ProxyEventGrouping.from_dict(obj["grouping"]) if obj.get("grouping") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_grouping.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_grouping.py new file mode 100644 index 000000000..bdf635e40 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/proxy_event_grouping.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ProxyEventGrouping(BaseModel): + """ + ProxyEventGrouping + """ # noqa: E501 + proxy: Optional[StrictStr] = Field(default=None, description="Proxy name or IP (for proxy events).") + __properties: ClassVar[List[str]] = ["proxy"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProxyEventGrouping from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "proxy", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProxyEventGrouping from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "proxy": obj.get("proxy") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/self_links.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/self_links.py new file mode 100644 index 000000000..5a584b769 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/self_links.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class SelfLinks(BaseModel): + """ + A links object containing the self link. + """ # noqa: E501 + var_self: Optional[Link] = Field(default=None, alias="self") + __properties: ClassVar[List[str]] = ["self"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SelfLinks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of var_self + if self.var_self: + _dict['self'] = self.var_self.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SelfLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "self": Link.from_dict(obj["self"]) if obj.get("self") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/severity.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/severity.py new file mode 100644 index 000000000..fae0c62dc --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/severity.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class Severity(str, Enum): + """ + The severity of the alert. + """ + + """ + allowed enum values + """ + HIGH = 'high' + MEDIUM = 'medium' + LOW = 'low' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Severity from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/simple_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/simple_event_detail.py new file mode 100644 index 000000000..e2ee56830 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/simple_event_detail.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.severity import Severity +from typing import Optional, Set +from typing_extensions import Self + +class SimpleEventDetail(BaseModel): + """ + SimpleEventDetail + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each event.") + type_name: Optional[StrictStr] = Field(default=None, description="Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue.", alias="typeName") + state: Optional[EventState] = None + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") + severity: Optional[Severity] = None + __properties: ClassVar[List[str]] = ["id", "typeName", "state", "startDate", "endDate", "severity"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SimpleEventDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "type_name", + "start_date", + "end_date", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SimpleEventDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "typeName": obj.get("typeName"), + "state": obj.get("state"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "severity": obj.get("severity") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_detail.py new file mode 100644 index 000000000..1740e576b --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_detail.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents +from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets +from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks +from thousandeyes_sdk.event_detection.models.severity import Severity +from thousandeyes_sdk.event_detection.models.target_event_grouping import TargetEventGrouping +from typing import Optional, Set +from typing_extensions import Self + +class TargetEventDetail(BaseModel): + """ + TargetEventDetail + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each event.") + type_name: Optional[StrictStr] = Field(default=None, description="Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue.", alias="typeName") + state: Optional[EventState] = None + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") + severity: Optional[Severity] = None + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") + affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") + affected_targets: Optional[AffectedTargets] = Field(default=None, alias="affectedTargets") + affected_agents: Optional[AffectedAgents] = Field(default=None, alias="affectedAgents") + cause: Optional[List[StrictStr]] = Field(default=None, description="The cause of the error.") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + type: Annotated[str, Field(strict=True)] = Field(description="Target event type.") + grouping: Optional[TargetEventGrouping] = None + __properties: ClassVar[List[str]] = ["id", "typeName", "state", "startDate", "endDate", "severity", "aid", "summary", "affectedTests", "affectedTargets", "affectedAgents", "cause", "_links", "type", "grouping"] + + @field_validator('type') + def type_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^target$", value): + raise ValueError(r"must validate the regular expression /^target$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TargetEventDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "type_name", + "start_date", + "end_date", + "summary", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of affected_tests + if self.affected_tests: + _dict['affectedTests'] = self.affected_tests.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_targets + if self.affected_targets: + _dict['affectedTargets'] = self.affected_targets.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_agents + if self.affected_agents: + _dict['affectedAgents'] = self.affected_agents.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of grouping + if self.grouping: + _dict['grouping'] = self.grouping.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TargetEventDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "typeName": obj.get("typeName"), + "state": obj.get("state"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "severity": obj.get("severity"), + "aid": obj.get("aid"), + "summary": obj.get("summary"), + "affectedTests": AffectedTests.from_dict(obj["affectedTests"]) if obj.get("affectedTests") is not None else None, + "affectedTargets": AffectedTargets.from_dict(obj["affectedTargets"]) if obj.get("affectedTargets") is not None else None, + "affectedAgents": AffectedAgents.from_dict(obj["affectedAgents"]) if obj.get("affectedAgents") is not None else None, + "cause": obj.get("cause"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "type": obj.get("type"), + "grouping": TargetEventGrouping.from_dict(obj["grouping"]) if obj.get("grouping") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_grouping.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_grouping.py new file mode 100644 index 000000000..6bebce000 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_event_grouping.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TargetEventGrouping(BaseModel): + """ + TargetEventGrouping + """ # noqa: E501 + target: Optional[StrictStr] = Field(default=None, description="Target name (for target events).") + __properties: ClassVar[List[str]] = ["target"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TargetEventGrouping from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "target", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TargetEventGrouping from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "target": obj.get("target") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_detail.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_detail.py new file mode 100644 index 000000000..160f34a5b --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_detail.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from thousandeyes_sdk.event_detection.models.affected_agents import AffectedAgents +from thousandeyes_sdk.event_detection.models.affected_targets import AffectedTargets +from thousandeyes_sdk.event_detection.models.affected_tests import AffectedTests +from thousandeyes_sdk.event_detection.models.event_state import EventState +from thousandeyes_sdk.event_detection.models.self_links import SelfLinks +from thousandeyes_sdk.event_detection.models.severity import Severity +from thousandeyes_sdk.event_detection.models.target_network_event_grouping import TargetNetworkEventGrouping +from typing import Optional, Set +from typing_extensions import Self + +class TargetNetworkEventDetail(BaseModel): + """ + TargetNetworkEventDetail + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="A unique ID for each event.") + type_name: Optional[StrictStr] = Field(default=None, description="Event type name. Examples include, Local Agent Issue, Network Path Issue, Network Outage, DNS Issue, Server Issue, and Proxy Issue.", alias="typeName") + state: Optional[EventState] = None + start_date: Optional[datetime] = Field(default=None, description="The start date and time (in UTC, ISO 8601 format) when the event was first detected.", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The end date and time (in UTC, ISO 8601 format) when the event was resolved (due to timeout). This value is populated for \"ongoing\" events.", alias="endDate") + severity: Optional[Severity] = None + aid: Optional[StrictStr] = Field(default=None, description="A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint.") + summary: Optional[StrictStr] = Field(default=None, description="A brief summary describing the cause of the event.") + affected_tests: Optional[AffectedTests] = Field(default=None, alias="affectedTests") + affected_targets: Optional[AffectedTargets] = Field(default=None, alias="affectedTargets") + affected_agents: Optional[AffectedAgents] = Field(default=None, alias="affectedAgents") + cause: Optional[List[StrictStr]] = Field(default=None, description="The cause of the error.") + links: Optional[SelfLinks] = Field(default=None, alias="_links") + type: Annotated[str, Field(strict=True)] = Field(description="Target network event type.") + grouping: Optional[TargetNetworkEventGrouping] = None + __properties: ClassVar[List[str]] = ["id", "typeName", "state", "startDate", "endDate", "severity", "aid", "summary", "affectedTests", "affectedTargets", "affectedAgents", "cause", "_links", "type", "grouping"] + + @field_validator('type') + def type_validate_regular_expression(cls, value): + """Validates the regular expression""" + if not re.match(r"^target-network$", value): + raise ValueError(r"must validate the regular expression /^target-network$/") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TargetNetworkEventDetail from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "type_name", + "start_date", + "end_date", + "summary", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of affected_tests + if self.affected_tests: + _dict['affectedTests'] = self.affected_tests.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_targets + if self.affected_targets: + _dict['affectedTargets'] = self.affected_targets.to_dict() + # override the default output from pydantic by calling `to_dict()` of affected_agents + if self.affected_agents: + _dict['affectedAgents'] = self.affected_agents.to_dict() + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['_links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of grouping + if self.grouping: + _dict['grouping'] = self.grouping.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TargetNetworkEventDetail from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "typeName": obj.get("typeName"), + "state": obj.get("state"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "severity": obj.get("severity"), + "aid": obj.get("aid"), + "summary": obj.get("summary"), + "affectedTests": AffectedTests.from_dict(obj["affectedTests"]) if obj.get("affectedTests") is not None else None, + "affectedTargets": AffectedTargets.from_dict(obj["affectedTargets"]) if obj.get("affectedTargets") is not None else None, + "affectedAgents": AffectedAgents.from_dict(obj["affectedAgents"]) if obj.get("affectedAgents") is not None else None, + "cause": obj.get("cause"), + "_links": SelfLinks.from_dict(obj["_links"]) if obj.get("_links") is not None else None, + "type": obj.get("type"), + "grouping": TargetNetworkEventGrouping.from_dict(obj["grouping"]) if obj.get("grouping") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_grouping.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_grouping.py new file mode 100644 index 000000000..f1ff83ae4 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/target_network_event_grouping.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TargetNetworkEventGrouping(BaseModel): + """ + TargetNetworkEventGrouping + """ # noqa: E501 + prefix: Optional[StrictStr] = Field(default=None, description="Prefix value for target-network events.") + __properties: ClassVar[List[str]] = ["prefix"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TargetNetworkEventGrouping from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "prefix", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TargetNetworkEventGrouping from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "prefix": obj.get("prefix") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/test_links.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/test_links.py new file mode 100644 index 000000000..493bf4ce8 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/test_links.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.link import Link +from typing import Optional, Set +from typing_extensions import Self + +class TestLinks(BaseModel): + """ + A links object containing the self link. + """ # noqa: E501 + test: Optional[Link] = None + __properties: ClassVar[List[str]] = ["test"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TestLinks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of test + if self.test: + _dict['test'] = self.test.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TestLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "test": Link.from_dict(obj["test"]) if obj.get("test") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/test_type.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/test_type.py new file mode 100644 index 000000000..b7d4da248 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/test_type.py @@ -0,0 +1,47 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class TestType(str, Enum): + """ + This is a read only value, as test type is implicit in the test creation url. + """ + + """ + allowed enum values + """ + API = 'api' + AGENT_MINUS_TO_MINUS_AGENT = 'agent-to-agent' + AGENT_MINUS_TO_MINUS_SERVER = 'agent-to-server' + BGP = 'bgp' + HTTP_MINUS_SERVER = 'http-server' + PAGE_MINUS_LOAD = 'page-load' + WEB_MINUS_TRANSACTIONS = 'web-transactions' + FTP_MINUS_SERVER = 'ftp-server' + DNS_MINUS_TRACE = 'dns-trace' + DNS_MINUS_SERVER = 'dns-server' + DNSSEC = 'dnssec' + SIP_MINUS_SERVER = 'sip-server' + VOICE = 'voice' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TestType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/unauthorized_error.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/unauthorized_error.py new file mode 100644 index 000000000..5788a83f1 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/unauthorized_error.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class UnauthorizedError(BaseModel): + """ + UnauthorizedError + """ # noqa: E501 + error: Optional[StrictStr] = None + error_description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["error", "error_description"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UnauthorizedError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UnauthorizedError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "error_description": obj.get("error_description") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/validation_error.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/validation_error.py new file mode 100644 index 000000000..a8b748169 --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/validation_error.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from thousandeyes_sdk.event_detection.models.validation_error_item import ValidationErrorItem +from typing import Optional, Set +from typing_extensions import Self + +class ValidationError(BaseModel): + """ + ValidationError + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the problem type. When this member is not present, its value is assumed to be \"about:blank\".") + title: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the problem type.") + status: Optional[StrictInt] = Field(default=None, description="The HTTP status code generated by the origin server for this occurrence of the problem.") + detail: Optional[StrictStr] = Field(default=None, description="A human-readable explanation specific to this occurrence of the problem.") + instance: Optional[StrictStr] = Field(default=None, description="A URI reference that identifies the specific occurrence of the problem.") + errors: Optional[List[ValidationErrorItem]] = Field(default=None, description="(Optional) When multiple errors occur, the details for each error are listed.") + __properties: ClassVar[List[str]] = ["type", "title", "status", "detail", "instance", "errors"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ValidationError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in errors (list) + _items = [] + if self.errors: + for _item in self.errors: + if _item: + _items.append(_item.to_dict()) + _dict['errors'] = _items + # set to None if errors (nullable) is None + # and model_fields_set contains the field + if self.errors is None and "errors" in self.model_fields_set: + _dict['errors'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ValidationError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "status": obj.get("status"), + "detail": obj.get("detail"), + "instance": obj.get("instance"), + "errors": [ValidationErrorItem.from_dict(_item) for _item in obj["errors"]] if obj.get("errors") is not None else None + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/validation_error_item.py b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/validation_error_item.py new file mode 100644 index 000000000..e2632ca8f --- /dev/null +++ b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/models/validation_error_item.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class ValidationErrorItem(BaseModel): + """ + ValidationErrorItem + """ # noqa: E501 + code: Optional[StrictStr] = Field(default=None, description="(Optional) A unique error type/code that can be referenced in the documentation for further details.") + var_field: Optional[StrictStr] = Field(default=None, description="Identifies the field that triggered this particular error.", alias="field") + message: Optional[StrictStr] = Field(default=None, description="A short, human-readable summary of the error.") + __properties: ClassVar[List[str]] = ["code", "field", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + extra="allow", + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return self.model_dump_json(by_alias=True, exclude_unset=True, exclude_none=True) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ValidationErrorItem from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ValidationErrorItem from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "field": obj.get("field"), + "message": obj.get("message") + }) + return _obj + + diff --git a/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/py.typed b/thousandeyes-sdk-event-detection/src/thousandeyes_sdk/event_detection/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/thousandeyes-sdk-event-detection/test/__init__.py b/thousandeyes-sdk-event-detection/test/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/thousandeyes-sdk-event-detection/test/test_events_api.py b/thousandeyes-sdk-event-detection/test/test_events_api.py new file mode 100644 index 000000000..faa281c5c --- /dev/null +++ b/thousandeyes-sdk-event-detection/test/test_events_api.py @@ -0,0 +1,275 @@ +# coding: utf-8 + +""" + Event Detection API + + 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](https://docs.thousandeyes.com/product-documentation/event-detection). + + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import json +import unittest +import thousandeyes_sdk.event_detection.models + +from .test_utils import assert_constructed_model_matches_example_json +from thousandeyes_sdk.event_detection.api.events_api import EventsApi + + +class TestEventsApi(unittest.TestCase): + """EventsApi unit test stubs""" + + def setUp(self) -> None: + self.api = EventsApi() + + def tearDown(self) -> None: + pass + + def test_get_event_models_validation(self) -> None: + """Test case for get_event request and response models""" + + response_body_json = """ + { + "severity" : "medium", + "summary" : "Significant number of issues detected with 66.29.146.15", + "affectedTests" : { + "total" : 5, + "tests" : [ { + "affectedTargetIds" : [ "123", "1234" ], + "affectedAgentIds" : [ "2954", "2953" ], + "_links" : { + "test" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "name" : "Google test", + "testType" : "agent-to-server", + "testId" : "226770" + }, { + "affectedTargetIds" : [ "123", "1234" ], + "affectedAgentIds" : [ "2954", "2953" ], + "_links" : { + "test" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "name" : "Google test", + "testType" : "agent-to-server", + "testId" : "226770" + } ], + "inAccountGroup" : 2 + }, + "endDate" : "2020-04-23T13:43:16Z", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "typeName" : "Network Issue", + "cause" : [ "Network Loss and/or High RTT" ], + "affectedTargets" : { + "total" : 5, + "inAccountGroup" : 2, + "targets" : [ { + "affectedAgentIds" : [ "2954", "2953" ], + "ip" : "216.239.32.10", + "name" : "google.com", + "affectedTestIds" : [ "123", "1234" ], + "serverId" : "123" + }, { + "affectedAgentIds" : [ "2954", "2953" ], + "ip" : "216.239.32.10", + "name" : "google.com", + "affectedTestIds" : [ "123", "1234" ], + "serverId" : "123" + } ] + }, + "type" : "target", + "grouping" : { + "target" : "google.com" + }, + "affectedAgents" : { + "total" : 5, + "inAccountGroup" : 2, + "agents" : [ { + "affectedTargetIds" : [ "123", "1234" ], + "agentId" : "2954", + "_links" : { + "agent" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "countryCode" : "BR", + "name" : "São Paulo, Brazil - agent", + "location" : "São Paulo, Brazil", + "affectedTestIds" : [ "2954", "2953" ], + "type" : "enterprise-cluster" + }, { + "affectedTargetIds" : [ "123", "1234" ], + "agentId" : "2954", + "_links" : { + "agent" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "countryCode" : "BR", + "name" : "São Paulo, Brazil - agent", + "location" : "São Paulo, Brazil", + "affectedTestIds" : [ "2954", "2953" ], + "type" : "enterprise-cluster" + } ] + }, + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "state" : "resolved", + "aid" : "1234", + "startDate" : "2020-04-23T13:43:16Z" + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.event_detection.models.EventDetail.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + def test_get_events_models_validation(self) -> None: + """Test case for get_events request and response models""" + + response_body_json = """ + { + "endDate" : "2022-07-18T22:00:54Z", + "_links" : { + "next" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + }, + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "aid" : "1234", + "startDate" : "2022-07-17T22:00:54Z", + "events" : [ { + "severity" : "medium", + "affectedTests" : { + "total" : 5, + "inAccountGroup" : 2 + }, + "endDate" : "2020-04-23T13:43:16Z", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "affectedAgents" : { + "total" : 5, + "inAccountGroup" : 2 + }, + "typeName" : "Network Issue", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "state" : "resolved", + "title" : "Affecting destinations in google.com", + "type" : "target", + "affectedTargets" : { + "total" : 5, + "inAccountGroup" : 2 + }, + "startDate" : "2020-04-23T13:43:16Z" + }, { + "severity" : "medium", + "affectedTests" : { + "total" : 5, + "inAccountGroup" : 2 + }, + "endDate" : "2020-04-23T13:43:16Z", + "_links" : { + "self" : { + "hreflang" : "hreflang", + "templated" : true, + "profile" : "profile", + "name" : "name", + "href" : "https://api.thousandeyes.com/v7/link/to/resource/id", + "type" : "type", + "deprecation" : "deprecation", + "title" : "title" + } + }, + "affectedAgents" : { + "total" : 5, + "inAccountGroup" : 2 + }, + "typeName" : "Network Issue", + "id" : "e9c3bf02-a48c-4aa8-9e5f-898800d6f569", + "state" : "resolved", + "title" : "Affecting destinations in google.com", + "type" : "target", + "affectedTargets" : { + "total" : 5, + "inAccountGroup" : 2 + }, + "startDate" : "2020-04-23T13:43:16Z" + } ] + }""" + + response_loaded_json = json.loads(response_body_json) + response_from_json = thousandeyes_sdk.event_detection.models.Events.from_json(response_body_json) + assert_constructed_model_matches_example_json(response_from_json, response_loaded_json) + + +if __name__ == '__main__': + unittest.main() diff --git a/thousandeyes-sdk-event-detection/test/test_utils.py b/thousandeyes-sdk-event-detection/test/test_utils.py new file mode 100644 index 000000000..930528d9b --- /dev/null +++ b/thousandeyes-sdk-event-detection/test/test_utils.py @@ -0,0 +1,16 @@ +# coding: utf-8 + +import json +import unittest + +from pydantic import BaseModel + + +def assert_constructed_model_matches_example_json(model: BaseModel, loaded_json: dict): + test_case = unittest.TestCase() + test_case.maxDiff = None + test_case.assertIsNotNone(model) + constructed_json = json.loads(model.to_json()) + sorted_loaded_json = json.dumps(loaded_json, sort_keys=True) + sorted_constructed_json = json.dumps(constructed_json, sort_keys=True) + test_case.assertEqual(sorted_loaded_json, sorted_constructed_json)