CP-1656 Add SDK for endpoints

This commit is contained in:
Shahid Hussain Khan 2023-12-11 09:29:15 +00:00
parent 8e45612762
commit 8f44835d59
3463 changed files with 324786 additions and 0 deletions

38
agents_api/.github/workflows/python.yml vendored Normal file
View File

@ -0,0 +1,38 @@
# NOTE: This file is auto generated by OpenAPI Generator.
# URL: https://openapi-generator.tech
#
# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: agents_api Python package
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest

66
agents_api/.gitignore vendored Normal file
View File

@ -0,0 +1,66 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
venv/
.venv/
.python-version
.pytest_cache
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
#Ipython Notebook
.ipynb_checkpoints

31
agents_api/.gitlab-ci.yml Normal file
View File

@ -0,0 +1,31 @@
# NOTE: This file is auto generated by OpenAPI Generator.
# URL: https://openapi-generator.tech
#
# ref: https://docs.gitlab.com/ee/ci/README.html
# ref: https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Python.gitlab-ci.yml
stages:
- test
.pytest:
stage: test
script:
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- pytest --cov=agents_api
pytest-3.7:
extends: .pytest
image: python:3.7-alpine
pytest-3.8:
extends: .pytest
image: python:3.8-alpine
pytest-3.9:
extends: .pytest
image: python:3.9-alpine
pytest-3.10:
extends: .pytest
image: python:3.10-alpine
pytest-3.11:
extends: .pytest
image: python:3.11-alpine

View File

@ -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

View File

@ -0,0 +1,203 @@
.github/workflows/python.yml
.gitignore
.gitlab-ci.yml
.openapi-generator-ignore
.travis.yml
README.md
agents_api/__init__.py
agents_api/api/__init__.py
agents_api/api/cloud_and_enterprise_agent_notification_rules_api.py
agents_api/api/cloud_and_enterprise_agents_api.py
agents_api/api/enterprise_agent_cluster_api.py
agents_api/api/proxies_api.py
agents_api/api_client.py
agents_api/api_response.py
agents_api/configuration.py
agents_api/exceptions.py
agents_api/models/__init__.py
agents_api/models/account_group.py
agents_api/models/account_group_id.py
agents_api/models/agent.py
agents_api/models/agent_base.py
agents_api/models/agent_detail.py
agents_api/models/agent_details.py
agents_api/models/agent_details_expand.py
agents_api/models/agent_ipv6_policy.py
agents_api/models/agent_list_expand.py
agents_api/models/agent_proxies.py
agents_api/models/agent_proxy.py
agents_api/models/agents.py
agents_api/models/alert_email.py
agents_api/models/alert_integration_base.py
agents_api/models/alert_integration_type.py
agents_api/models/assign_enterprise_agent_cluster_request.py
agents_api/models/cloud_enterprise_agent.py
agents_api/models/cloud_enterprise_agent_type.py
agents_api/models/cloud_enterprise_agents.py
agents_api/models/cluster_member.py
agents_api/models/enterprise_agent.py
agents_api/models/enterprise_agent_detail.py
agents_api/models/enterprise_agent_ipv6_policy.py
agents_api/models/enterprise_agent_request_body.py
agents_api/models/enterprise_agent_state.py
agents_api/models/error.py
agents_api/models/error_detail.py
agents_api/models/error_detail_code.py
agents_api/models/get_agent_details200_response.py
agents_api/models/get_agent_proxies200_response.py
agents_api/models/get_agents200_response.py
agents_api/models/get_agents_notification_rule200_response.py
agents_api/models/get_agents_notification_rules200_response.py
agents_api/models/interface_ip_mapping.py
agents_api/models/labels.py
agents_api/models/link.py
agents_api/models/notification.py
agents_api/models/notification_rule.py
agents_api/models/notification_rule_detail.py
agents_api/models/notification_rules.py
agents_api/models/notifications.py
agents_api/models/proxy_auth_type.py
agents_api/models/proxy_type.py
agents_api/models/self_links.py
agents_api/models/self_links_links.py
agents_api/models/simple_test.py
agents_api/models/test_interval.py
agents_api/models/test_type.py
agents_api/models/unassign_enterprise_agent_from_cluster_request.py
agents_api/models/unauthorized_error.py
agents_api/models/unexpanded_instant_test.py
agents_api/models/unexpanded_instant_test_links.py
agents_api/models/unexpanded_instant_test_links_self.py
agents_api/models/unexpanded_instant_test_links_test_results.py
agents_api/models/unexpanded_test.py
agents_api/models/update_enterprise_agent_details200_response.py
agents_api/py.typed
agents_api/rest.py
docs/AccountGroup.md
docs/AccountGroupId.md
docs/Agent.md
docs/AgentBase.md
docs/AgentDetail.md
docs/AgentDetails.md
docs/AgentDetailsExpand.md
docs/AgentIpv6Policy.md
docs/AgentListExpand.md
docs/AgentProxies.md
docs/AgentProxy.md
docs/Agents.md
docs/AlertEmail.md
docs/AlertIntegrationBase.md
docs/AlertIntegrationType.md
docs/AssignEnterpriseAgentClusterRequest.md
docs/CloudAndEnterpriseAgentNotificationRulesApi.md
docs/CloudAndEnterpriseAgentsApi.md
docs/CloudEnterpriseAgent.md
docs/CloudEnterpriseAgentType.md
docs/CloudEnterpriseAgents.md
docs/ClusterMember.md
docs/EnterpriseAgent.md
docs/EnterpriseAgentClusterApi.md
docs/EnterpriseAgentDetail.md
docs/EnterpriseAgentIpv6Policy.md
docs/EnterpriseAgentRequestBody.md
docs/EnterpriseAgentState.md
docs/Error.md
docs/ErrorDetail.md
docs/ErrorDetailCode.md
docs/GetAgentDetails200Response.md
docs/GetAgentProxies200Response.md
docs/GetAgents200Response.md
docs/GetAgentsNotificationRule200Response.md
docs/GetAgentsNotificationRules200Response.md
docs/InterfaceIpMapping.md
docs/Labels.md
docs/Link.md
docs/Notification.md
docs/NotificationRule.md
docs/NotificationRuleDetail.md
docs/NotificationRules.md
docs/Notifications.md
docs/ProxiesApi.md
docs/ProxyAuthType.md
docs/ProxyType.md
docs/SelfLinks.md
docs/SelfLinksLinks.md
docs/SimpleTest.md
docs/TestInterval.md
docs/TestType.md
docs/UnassignEnterpriseAgentFromClusterRequest.md
docs/UnauthorizedError.md
docs/UnexpandedInstantTest.md
docs/UnexpandedInstantTestLinks.md
docs/UnexpandedInstantTestLinksSelf.md
docs/UnexpandedInstantTestLinksTestResults.md
docs/UnexpandedTest.md
docs/UpdateEnterpriseAgentDetails200Response.md
git_push.sh
pyproject.toml
requirements.txt
setup.cfg
setup.py
test-requirements.txt
test/__init__.py
test/test_account_group.py
test/test_account_group_id.py
test/test_agent.py
test/test_agent_base.py
test/test_agent_detail.py
test/test_agent_details.py
test/test_agent_details_expand.py
test/test_agent_ipv6_policy.py
test/test_agent_list_expand.py
test/test_agent_proxies.py
test/test_agent_proxy.py
test/test_agents.py
test/test_alert_email.py
test/test_alert_integration_base.py
test/test_alert_integration_type.py
test/test_assign_enterprise_agent_cluster_request.py
test/test_cloud_and_enterprise_agent_notification_rules_api.py
test/test_cloud_and_enterprise_agents_api.py
test/test_cloud_enterprise_agent.py
test/test_cloud_enterprise_agent_type.py
test/test_cloud_enterprise_agents.py
test/test_cluster_member.py
test/test_enterprise_agent.py
test/test_enterprise_agent_cluster_api.py
test/test_enterprise_agent_detail.py
test/test_enterprise_agent_ipv6_policy.py
test/test_enterprise_agent_request_body.py
test/test_enterprise_agent_state.py
test/test_error.py
test/test_error_detail.py
test/test_error_detail_code.py
test/test_get_agent_details200_response.py
test/test_get_agent_proxies200_response.py
test/test_get_agents200_response.py
test/test_get_agents_notification_rule200_response.py
test/test_get_agents_notification_rules200_response.py
test/test_interface_ip_mapping.py
test/test_labels.py
test/test_link.py
test/test_notification.py
test/test_notification_rule.py
test/test_notification_rule_detail.py
test/test_notification_rules.py
test/test_notifications.py
test/test_proxies_api.py
test/test_proxy_auth_type.py
test/test_proxy_type.py
test/test_self_links.py
test/test_self_links_links.py
test/test_simple_test.py
test/test_test_interval.py
test/test_test_type.py
test/test_unassign_enterprise_agent_from_cluster_request.py
test/test_unauthorized_error.py
test/test_unexpanded_instant_test.py
test/test_unexpanded_instant_test_links.py
test/test_unexpanded_instant_test_links_self.py
test/test_unexpanded_instant_test_links_test_results.py
test/test_unexpanded_test.py
test/test_update_enterprise_agent_details200_response.py
tox.ini

View File

@ -0,0 +1 @@
7.1.0

17
agents_api/.travis.yml Normal file
View File

@ -0,0 +1,17 @@
# ref: https://docs.travis-ci.com/user/languages/python
language: python
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
- "3.11"
# uncomment the following if needed
#- "3.11-dev" # 3.11 development branch
#- "nightly" # nightly build
# command to install dependencies
install:
- "pip install -r requirements.txt"
- "pip install -r test-requirements.txt"
# command to run tests
script: pytest --cov=agents_api

186
agents_api/README.md Normal file
View File

@ -0,0 +1,186 @@
# agents-api
## Overview
Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 7.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements.
Python 3.7+
## Installation & Usage
### pip install
If the python package is hosted on a repository, you can install directly using:
```sh
pip install git+https://github.com/thousandeyes/thousandeyes-python-sdk.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/thousandeyes/thousandeyes-python-sdk.git`)
Then import the package:
```python
import agents_api
```
### Setuptools
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)
Then import the package:
```python
import agents_api
```
### Tests
Execute `pytest` to run the tests.
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
import time
import agents_api
from agents_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = agents_api.Configuration(
host = "https://api.thousandeyes.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = agents_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with agents_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = agents_api.CloudAndEnterpriseAgentNotificationRulesApi(api_client)
notification_rule_id = '281474976710706' # str | Unique ID for the agent notification rule.
aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
try:
# Retrieve agent notification rule
api_response = api_instance.get_agents_notification_rule(notification_rule_id, aid=aid)
print("The response of CloudAndEnterpriseAgentNotificationRulesApi->get_agents_notification_rule:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling CloudAndEnterpriseAgentNotificationRulesApi->get_agents_notification_rule: %s\n" % e)
```
## Documentation for API Endpoints
All URIs are relative to *https://api.thousandeyes.com*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*CloudAndEnterpriseAgentNotificationRulesApi* | [**get_agents_notification_rule**](docs/CloudAndEnterpriseAgentNotificationRulesApi.md#get_agents_notification_rule) | **GET** /v7/agents/notification-rules/{notificationRuleId} | Retrieve agent notification rule
*CloudAndEnterpriseAgentNotificationRulesApi* | [**get_agents_notification_rules**](docs/CloudAndEnterpriseAgentNotificationRulesApi.md#get_agents_notification_rules) | **GET** /v7/agents/notification-rules | List agent notification rules
*CloudAndEnterpriseAgentsApi* | [**delete_enterprise_agent**](docs/CloudAndEnterpriseAgentsApi.md#delete_enterprise_agent) | **DELETE** /v7/agents/{agentId} | Delete Enterprise Agent
*CloudAndEnterpriseAgentsApi* | [**get_agent_details**](docs/CloudAndEnterpriseAgentsApi.md#get_agent_details) | **GET** /v7/agents/{agentId} | Retrieve Cloud and Enterprise Agent
*CloudAndEnterpriseAgentsApi* | [**get_agents**](docs/CloudAndEnterpriseAgentsApi.md#get_agents) | **GET** /v7/agents | List Cloud and Enterprise Agents
*CloudAndEnterpriseAgentsApi* | [**update_enterprise_agent_details**](docs/CloudAndEnterpriseAgentsApi.md#update_enterprise_agent_details) | **PUT** /v7/agents/{agentId} | Update Enterprise Agent
*EnterpriseAgentClusterApi* | [**assign_enterprise_agent_cluster**](docs/EnterpriseAgentClusterApi.md#assign_enterprise_agent_cluster) | **POST** /v7/agents/{agentId}/cluster/assign | Add member to Enterprise Agent cluster
*EnterpriseAgentClusterApi* | [**unassign_enterprise_agent_from_cluster**](docs/EnterpriseAgentClusterApi.md#unassign_enterprise_agent_from_cluster) | **POST** /v7/agents/{agentId}/cluster/unassign | Remove member from Enterprise Agent cluster
*ProxiesApi* | [**get_agent_proxies**](docs/ProxiesApi.md#get_agent_proxies) | **GET** /v7/agents/proxies | List agent proxies
## Documentation For Models
- [AccountGroup](docs/AccountGroup.md)
- [AccountGroupId](docs/AccountGroupId.md)
- [Agent](docs/Agent.md)
- [AgentBase](docs/AgentBase.md)
- [AgentDetail](docs/AgentDetail.md)
- [AgentDetails](docs/AgentDetails.md)
- [AgentDetailsExpand](docs/AgentDetailsExpand.md)
- [AgentIpv6Policy](docs/AgentIpv6Policy.md)
- [AgentListExpand](docs/AgentListExpand.md)
- [AgentProxies](docs/AgentProxies.md)
- [AgentProxy](docs/AgentProxy.md)
- [Agents](docs/Agents.md)
- [AlertEmail](docs/AlertEmail.md)
- [AlertIntegrationBase](docs/AlertIntegrationBase.md)
- [AlertIntegrationType](docs/AlertIntegrationType.md)
- [AssignEnterpriseAgentClusterRequest](docs/AssignEnterpriseAgentClusterRequest.md)
- [CloudEnterpriseAgent](docs/CloudEnterpriseAgent.md)
- [CloudEnterpriseAgentType](docs/CloudEnterpriseAgentType.md)
- [CloudEnterpriseAgents](docs/CloudEnterpriseAgents.md)
- [ClusterMember](docs/ClusterMember.md)
- [EnterpriseAgent](docs/EnterpriseAgent.md)
- [EnterpriseAgentDetail](docs/EnterpriseAgentDetail.md)
- [EnterpriseAgentIpv6Policy](docs/EnterpriseAgentIpv6Policy.md)
- [EnterpriseAgentRequestBody](docs/EnterpriseAgentRequestBody.md)
- [EnterpriseAgentState](docs/EnterpriseAgentState.md)
- [Error](docs/Error.md)
- [ErrorDetail](docs/ErrorDetail.md)
- [ErrorDetailCode](docs/ErrorDetailCode.md)
- [GetAgentDetails200Response](docs/GetAgentDetails200Response.md)
- [GetAgentProxies200Response](docs/GetAgentProxies200Response.md)
- [GetAgents200Response](docs/GetAgents200Response.md)
- [GetAgentsNotificationRule200Response](docs/GetAgentsNotificationRule200Response.md)
- [GetAgentsNotificationRules200Response](docs/GetAgentsNotificationRules200Response.md)
- [InterfaceIpMapping](docs/InterfaceIpMapping.md)
- [Labels](docs/Labels.md)
- [Link](docs/Link.md)
- [Notification](docs/Notification.md)
- [NotificationRule](docs/NotificationRule.md)
- [NotificationRuleDetail](docs/NotificationRuleDetail.md)
- [NotificationRules](docs/NotificationRules.md)
- [Notifications](docs/Notifications.md)
- [ProxyAuthType](docs/ProxyAuthType.md)
- [ProxyType](docs/ProxyType.md)
- [SelfLinks](docs/SelfLinks.md)
- [SelfLinksLinks](docs/SelfLinksLinks.md)
- [SimpleTest](docs/SimpleTest.md)
- [TestInterval](docs/TestInterval.md)
- [TestType](docs/TestType.md)
- [UnassignEnterpriseAgentFromClusterRequest](docs/UnassignEnterpriseAgentFromClusterRequest.md)
- [UnauthorizedError](docs/UnauthorizedError.md)
- [UnexpandedInstantTest](docs/UnexpandedInstantTest.md)
- [UnexpandedInstantTestLinks](docs/UnexpandedInstantTestLinks.md)
- [UnexpandedInstantTestLinksSelf](docs/UnexpandedInstantTestLinksSelf.md)
- [UnexpandedInstantTestLinksTestResults](docs/UnexpandedInstantTestLinksTestResults.md)
- [UnexpandedTest](docs/UnexpandedTest.md)
- [UpdateEnterpriseAgentDetails200Response](docs/UpdateEnterpriseAgentDetails200Response.md)
<a id="documentation-for-authorization"></a>
## Documentation For Authorization
Authentication schemes defined for the API:
<a id="BearerAuth"></a>
### BearerAuth
- **Type**: Bearer authentication
## Author

View File

@ -0,0 +1,92 @@
# coding: utf-8
# flake8: noqa
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
__version__ = "1.0.0"
# import apis into sdk package
from agents_api.api.cloud_and_enterprise_agent_notification_rules_api import CloudAndEnterpriseAgentNotificationRulesApi
from agents_api.api.cloud_and_enterprise_agents_api import CloudAndEnterpriseAgentsApi
from agents_api.api.enterprise_agent_cluster_api import EnterpriseAgentClusterApi
from agents_api.api.proxies_api import ProxiesApi
# import ApiClient
from agents_api.api_response import ApiResponse
from agents_api.api_client import ApiClient
from agents_api.configuration import Configuration
from agents_api.exceptions import OpenApiException
from agents_api.exceptions import ApiTypeError
from agents_api.exceptions import ApiValueError
from agents_api.exceptions import ApiKeyError
from agents_api.exceptions import ApiAttributeError
from agents_api.exceptions import ApiException
# import models into sdk package
from agents_api.models.account_group import AccountGroup
from agents_api.models.account_group_id import AccountGroupId
from agents_api.models.agent import Agent
from agents_api.models.agent_base import AgentBase
from agents_api.models.agent_detail import AgentDetail
from agents_api.models.agent_details import AgentDetails
from agents_api.models.agent_details_expand import AgentDetailsExpand
from agents_api.models.agent_ipv6_policy import AgentIpv6Policy
from agents_api.models.agent_list_expand import AgentListExpand
from agents_api.models.agent_proxies import AgentProxies
from agents_api.models.agent_proxy import AgentProxy
from agents_api.models.agents import Agents
from agents_api.models.alert_email import AlertEmail
from agents_api.models.alert_integration_base import AlertIntegrationBase
from agents_api.models.alert_integration_type import AlertIntegrationType
from agents_api.models.assign_enterprise_agent_cluster_request import AssignEnterpriseAgentClusterRequest
from agents_api.models.cloud_enterprise_agent import CloudEnterpriseAgent
from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
from agents_api.models.cloud_enterprise_agents import CloudEnterpriseAgents
from agents_api.models.cluster_member import ClusterMember
from agents_api.models.enterprise_agent import EnterpriseAgent
from agents_api.models.enterprise_agent_detail import EnterpriseAgentDetail
from agents_api.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy
from agents_api.models.enterprise_agent_request_body import EnterpriseAgentRequestBody
from agents_api.models.enterprise_agent_state import EnterpriseAgentState
from agents_api.models.error import Error
from agents_api.models.error_detail import ErrorDetail
from agents_api.models.error_detail_code import ErrorDetailCode
from agents_api.models.get_agent_details200_response import GetAgentDetails200Response
from agents_api.models.get_agent_proxies200_response import GetAgentProxies200Response
from agents_api.models.get_agents200_response import GetAgents200Response
from agents_api.models.get_agents_notification_rule200_response import GetAgentsNotificationRule200Response
from agents_api.models.get_agents_notification_rules200_response import GetAgentsNotificationRules200Response
from agents_api.models.interface_ip_mapping import InterfaceIpMapping
from agents_api.models.labels import Labels
from agents_api.models.link import Link
from agents_api.models.notification import Notification
from agents_api.models.notification_rule import NotificationRule
from agents_api.models.notification_rule_detail import NotificationRuleDetail
from agents_api.models.notification_rules import NotificationRules
from agents_api.models.notifications import Notifications
from agents_api.models.proxy_auth_type import ProxyAuthType
from agents_api.models.proxy_type import ProxyType
from agents_api.models.self_links import SelfLinks
from agents_api.models.self_links_links import SelfLinksLinks
from agents_api.models.simple_test import SimpleTest
from agents_api.models.test_interval import TestInterval
from agents_api.models.test_type import TestType
from agents_api.models.unassign_enterprise_agent_from_cluster_request import UnassignEnterpriseAgentFromClusterRequest
from agents_api.models.unauthorized_error import UnauthorizedError
from agents_api.models.unexpanded_instant_test import UnexpandedInstantTest
from agents_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks
from agents_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf
from agents_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults
from agents_api.models.unexpanded_test import UnexpandedTest
from agents_api.models.update_enterprise_agent_details200_response import UpdateEnterpriseAgentDetails200Response

View File

@ -0,0 +1,8 @@
# flake8: noqa
# import apis into api package
from agents_api.api.cloud_and_enterprise_agent_notification_rules_api import CloudAndEnterpriseAgentNotificationRulesApi
from agents_api.api.cloud_and_enterprise_agents_api import CloudAndEnterpriseAgentsApi
from agents_api.api.enterprise_agent_cluster_api import EnterpriseAgentClusterApi
from agents_api.api.proxies_api import ProxiesApi

View File

@ -0,0 +1,637 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import io
import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any
try:
from typing import Annotated
except ImportError:
from typing_extensions import Annotated
from pydantic import Field
from typing_extensions import Annotated
from pydantic import StrictStr
from typing import Optional
from agents_api.models.get_agents_notification_rule200_response import GetAgentsNotificationRule200Response
from agents_api.models.get_agents_notification_rules200_response import GetAgentsNotificationRules200Response
from agents_api.api_client import ApiClient
from agents_api.api_response import ApiResponse
from agents_api.rest import RESTResponseType
class CloudAndEnterpriseAgentNotificationRulesApi:
"""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()
self.api_client = api_client
@validate_call
def get_agents_notification_rule(
self,
notification_rule_id: Annotated[StrictStr, Field(description="Unique ID for the agent notification rule.")],
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,
) -> GetAgentsNotificationRule200Response:
"""Retrieve agent notification rule
Returns details of an agent notification rule, including agents it is assigned to.
:param notification_rule_id: Unique ID for the agent notification rule. (required)
:type notification_rule_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_agents_notification_rule_serialize(
notification_rule_id=notification_rule_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': "GetAgentsNotificationRule200Response",
'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,
).data
@validate_call
def get_agents_notification_rule_with_http_info(
self,
notification_rule_id: Annotated[StrictStr, Field(description="Unique ID for the agent notification rule.")],
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[GetAgentsNotificationRule200Response]:
"""Retrieve agent notification rule
Returns details of an agent notification rule, including agents it is assigned to.
:param notification_rule_id: Unique ID for the agent notification rule. (required)
:type notification_rule_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_agents_notification_rule_serialize(
notification_rule_id=notification_rule_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': "GetAgentsNotificationRule200Response",
'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,
)
@validate_call
def get_agents_notification_rule_without_preload_content(
self,
notification_rule_id: Annotated[StrictStr, Field(description="Unique ID for the agent notification rule.")],
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 agent notification rule
Returns details of an agent notification rule, including agents it is assigned to.
:param notification_rule_id: Unique ID for the agent notification rule. (required)
:type notification_rule_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_agents_notification_rule_serialize(
notification_rule_id=notification_rule_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': "GetAgentsNotificationRule200Response",
'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_agents_notification_rule_serialize(
self,
notification_rule_id,
aid,
_request_auth,
_content_type,
_headers,
_host_index,
) -> Tuple:
_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
if notification_rule_id is not None:
_path_params['notificationRuleId'] = notification_rule_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/problem+json'
]
)
# authentication setting
_auth_settings: List[str] = [
'BearerAuth'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/v7/agents/notification-rules/{notificationRuleId}',
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_agents_notification_rules(
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,
_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,
) -> GetAgentsNotificationRules200Response:
"""List agent notification rules
Returns a list of all agent notification rules configured under the account.
: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_agents_notification_rules_serialize(
aid=aid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgentsNotificationRules200Response",
'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,
).data
@validate_call
def get_agents_notification_rules_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,
_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[GetAgentsNotificationRules200Response]:
"""List agent notification rules
Returns a list of all agent notification rules configured under the account.
: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_agents_notification_rules_serialize(
aid=aid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgentsNotificationRules200Response",
'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,
)
@validate_call
def get_agents_notification_rules_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,
_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 agent notification rules
Returns a list of all agent notification rules configured under the account.
: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_agents_notification_rules_serialize(
aid=aid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgentsNotificationRules200Response",
'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_agents_notification_rules_serialize(
self,
aid,
_request_auth,
_content_type,
_headers,
_host_index,
) -> Tuple:
_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# 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/problem+json'
]
)
# authentication setting
_auth_settings: List[str] = [
'BearerAuth'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/v7/agents/notification-rules',
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
)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,753 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import io
import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any
try:
from typing import Annotated
except ImportError:
from typing_extensions import Annotated
from pydantic import Field
from typing_extensions import Annotated
from pydantic import StrictStr
from typing import List, Optional
from agents_api.models.agent_details_expand import AgentDetailsExpand
from agents_api.models.assign_enterprise_agent_cluster_request import AssignEnterpriseAgentClusterRequest
from agents_api.models.get_agent_details200_response import GetAgentDetails200Response
from agents_api.models.get_agents200_response import GetAgents200Response
from agents_api.models.unassign_enterprise_agent_from_cluster_request import UnassignEnterpriseAgentFromClusterRequest
from agents_api.api_client import ApiClient
from agents_api.api_response import ApiResponse
from agents_api.rest import RESTResponseType
class EnterpriseAgentClusterApi:
"""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()
self.api_client = api_client
@validate_call
def assign_enterprise_agent_cluster(
self,
agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")],
assign_enterprise_agent_cluster_request: AssignEnterpriseAgentClusterRequest,
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,
expand: Annotated[Optional[List[AgentDetailsExpand]], Field(description="Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.")] = 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,
) -> GetAgentDetails200Response:
"""Add member to Enterprise Agent cluster
Adding a member to an Enterprise Agent cluster converts a standalone Enterprise Agent to an Enterprise Agent cluster. If the agent represented by the path {agentId} is not already a cluster, it will be converted to a cluster. The response will be a single Enterprise Agent Cluster. The converted Enterprise Agents will become cluster members, and can be returned using the `?expand=cluster-member` parameter. This endpoint requires users to have the `Edit agents in account group` permission. Upon successful cluster creation, the response includes: * Information about the new cluster in the response body. * Each cluster member receives a unique `memberId` within the cluster. * The `memberId` value is not linked to the original `agentId` used in the request URL or POST body. * The cluster name is based on the agent whose `agentId` is present in the request URL. **Example - converting a single agent** ``` curl -X POST https://api.thousandeyes.com/v7/agents/64965/cluster/assign -H \"Authorization: Bearer $Bearer_token\" ```` **Example - converting multiple agents** ``` curl https://api.thousandeyes.com/v7/agents/64965/cluster/assign \\ '{\"agents\":[ \"2277\", \"1234\" ]}' \\ -H \"content-type:application/json\" \\ -H \"Authorization: Bearer $Bearer_token\" ````
:param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required)
:type agent_id: str
:param assign_enterprise_agent_cluster_request: (required)
:type assign_enterprise_agent_cluster_request: AssignEnterpriseAgentClusterRequest
: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 expand: Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.
:type expand: List[AgentDetailsExpand]
: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._assign_enterprise_agent_cluster_serialize(
agent_id=agent_id,
assign_enterprise_agent_cluster_request=assign_enterprise_agent_cluster_request,
aid=aid,
expand=expand,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgentDetails200Response",
'400': "Error",
'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,
).data
@validate_call
def assign_enterprise_agent_cluster_with_http_info(
self,
agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")],
assign_enterprise_agent_cluster_request: AssignEnterpriseAgentClusterRequest,
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,
expand: Annotated[Optional[List[AgentDetailsExpand]], Field(description="Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.")] = 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[GetAgentDetails200Response]:
"""Add member to Enterprise Agent cluster
Adding a member to an Enterprise Agent cluster converts a standalone Enterprise Agent to an Enterprise Agent cluster. If the agent represented by the path {agentId} is not already a cluster, it will be converted to a cluster. The response will be a single Enterprise Agent Cluster. The converted Enterprise Agents will become cluster members, and can be returned using the `?expand=cluster-member` parameter. This endpoint requires users to have the `Edit agents in account group` permission. Upon successful cluster creation, the response includes: * Information about the new cluster in the response body. * Each cluster member receives a unique `memberId` within the cluster. * The `memberId` value is not linked to the original `agentId` used in the request URL or POST body. * The cluster name is based on the agent whose `agentId` is present in the request URL. **Example - converting a single agent** ``` curl -X POST https://api.thousandeyes.com/v7/agents/64965/cluster/assign -H \"Authorization: Bearer $Bearer_token\" ```` **Example - converting multiple agents** ``` curl https://api.thousandeyes.com/v7/agents/64965/cluster/assign \\ '{\"agents\":[ \"2277\", \"1234\" ]}' \\ -H \"content-type:application/json\" \\ -H \"Authorization: Bearer $Bearer_token\" ````
:param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required)
:type agent_id: str
:param assign_enterprise_agent_cluster_request: (required)
:type assign_enterprise_agent_cluster_request: AssignEnterpriseAgentClusterRequest
: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 expand: Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.
:type expand: List[AgentDetailsExpand]
: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._assign_enterprise_agent_cluster_serialize(
agent_id=agent_id,
assign_enterprise_agent_cluster_request=assign_enterprise_agent_cluster_request,
aid=aid,
expand=expand,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgentDetails200Response",
'400': "Error",
'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,
)
@validate_call
def assign_enterprise_agent_cluster_without_preload_content(
self,
agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to add new agents to.")],
assign_enterprise_agent_cluster_request: AssignEnterpriseAgentClusterRequest,
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,
expand: Annotated[Optional[List[AgentDetailsExpand]], Field(description="Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.")] = 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:
"""Add member to Enterprise Agent cluster
Adding a member to an Enterprise Agent cluster converts a standalone Enterprise Agent to an Enterprise Agent cluster. If the agent represented by the path {agentId} is not already a cluster, it will be converted to a cluster. The response will be a single Enterprise Agent Cluster. The converted Enterprise Agents will become cluster members, and can be returned using the `?expand=cluster-member` parameter. This endpoint requires users to have the `Edit agents in account group` permission. Upon successful cluster creation, the response includes: * Information about the new cluster in the response body. * Each cluster member receives a unique `memberId` within the cluster. * The `memberId` value is not linked to the original `agentId` used in the request URL or POST body. * The cluster name is based on the agent whose `agentId` is present in the request URL. **Example - converting a single agent** ``` curl -X POST https://api.thousandeyes.com/v7/agents/64965/cluster/assign -H \"Authorization: Bearer $Bearer_token\" ```` **Example - converting multiple agents** ``` curl https://api.thousandeyes.com/v7/agents/64965/cluster/assign \\ '{\"agents\":[ \"2277\", \"1234\" ]}' \\ -H \"content-type:application/json\" \\ -H \"Authorization: Bearer $Bearer_token\" ````
:param agent_id: Unique ID for the Enterprise Agent cluster to add new agents to. (required)
:type agent_id: str
:param assign_enterprise_agent_cluster_request: (required)
:type assign_enterprise_agent_cluster_request: AssignEnterpriseAgentClusterRequest
: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 expand: Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.
:type expand: List[AgentDetailsExpand]
: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._assign_enterprise_agent_cluster_serialize(
agent_id=agent_id,
assign_enterprise_agent_cluster_request=assign_enterprise_agent_cluster_request,
aid=aid,
expand=expand,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgentDetails200Response",
'400': "Error",
'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 _assign_enterprise_agent_cluster_serialize(
self,
agent_id,
assign_enterprise_agent_cluster_request,
aid,
expand,
_request_auth,
_content_type,
_headers,
_host_index,
) -> Tuple:
_host = None
_collection_formats: Dict[str, str] = {
'expand': 'csv',
}
_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
if agent_id is not None:
_path_params['agentId'] = agent_id
# process the query parameters
if aid is not None:
_query_params.append(('aid', aid))
if expand is not None:
_query_params.append(('expand', expand))
# process the header parameters
# process the form parameters
# process the body parameter
if assign_enterprise_agent_cluster_request is not None:
_body_params = assign_enterprise_agent_cluster_request
# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/hal+json',
'application/problem+json'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'BearerAuth'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/v7/agents/{agentId}/cluster/assign',
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 unassign_enterprise_agent_from_cluster(
self,
agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to remove agents from.")],
unassign_enterprise_agent_from_cluster_request: UnassignEnterpriseAgentFromClusterRequest,
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,
expand: Annotated[Optional[List[AgentDetailsExpand]], Field(description="Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.")] = 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,
) -> GetAgents200Response:
"""Remove member from Enterprise Agent cluster
Converts a cluster with a single or multiple Enterprise Agent members back to a standalone Enterprise Agent(s). This endpoint can also be used to remove one or more members from an Enterprise Agent cluster. Removed members revert to being standalone Enterprise Agents. If all members are removed from the cluster, the Enterprise Agent Cluster is deleted. The response is an list of agents, containing both the Enterprise Agent Cluster (if it still exists), and the removed members, now as standalone Enterprise Agents. This endpoint is exclusive to Enterprise Agent clusters and can be accessed only by users with the `Edit agents in account group` permission. On successful completion, the response contains the following information: * The updated cluster information is provided in the response body, unless all members are removed from the cluster. * Information about each removed member, now a standalone agent. * When a non-last member is removed from the cluster, it receives a new `agentId` value. This new `agentId` is different from the `agentId` the agent had before joining the cluster, and it is also unrelated to the `memberId` value the agent had while being a part of the cluster. * If all members are removed from the cluster, the cluster itself is converted back to a standalone Enterprise Agent too. Such standalone agent inherits the old clusters `agentId` value. The last `memberId` listed in the POST body inherits the clusters `agentId` value. **Example - removing a single member** ``` curl -X POST https://api.thousandeyes.com/v7/agents/64965/cluster/unassign \\ '{\"members\":[\"55974\"]}' \\ -H \"content-type:application/json\" \\ -H \"Authorization: Bearer $Bearer_token\" ``` **Example - removing multiple members** ``` curl https://api.thousandeyes.com/v7/agents/64965/cluster/unassign \\ '{\"members\":[ \"55974\", \"12313\"] }' \\ -H \"content-type:application/json\" \\ -H \"Authorization: Bearer $Bearer_token\" ```
:param agent_id: Unique ID for the Enterprise Agent cluster to remove agents from. (required)
:type agent_id: str
:param unassign_enterprise_agent_from_cluster_request: (required)
:type unassign_enterprise_agent_from_cluster_request: UnassignEnterpriseAgentFromClusterRequest
: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 expand: Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.
:type expand: List[AgentDetailsExpand]
: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._unassign_enterprise_agent_from_cluster_serialize(
agent_id=agent_id,
unassign_enterprise_agent_from_cluster_request=unassign_enterprise_agent_from_cluster_request,
aid=aid,
expand=expand,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgents200Response",
'400': "Error",
'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,
).data
@validate_call
def unassign_enterprise_agent_from_cluster_with_http_info(
self,
agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to remove agents from.")],
unassign_enterprise_agent_from_cluster_request: UnassignEnterpriseAgentFromClusterRequest,
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,
expand: Annotated[Optional[List[AgentDetailsExpand]], Field(description="Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.")] = 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[GetAgents200Response]:
"""Remove member from Enterprise Agent cluster
Converts a cluster with a single or multiple Enterprise Agent members back to a standalone Enterprise Agent(s). This endpoint can also be used to remove one or more members from an Enterprise Agent cluster. Removed members revert to being standalone Enterprise Agents. If all members are removed from the cluster, the Enterprise Agent Cluster is deleted. The response is an list of agents, containing both the Enterprise Agent Cluster (if it still exists), and the removed members, now as standalone Enterprise Agents. This endpoint is exclusive to Enterprise Agent clusters and can be accessed only by users with the `Edit agents in account group` permission. On successful completion, the response contains the following information: * The updated cluster information is provided in the response body, unless all members are removed from the cluster. * Information about each removed member, now a standalone agent. * When a non-last member is removed from the cluster, it receives a new `agentId` value. This new `agentId` is different from the `agentId` the agent had before joining the cluster, and it is also unrelated to the `memberId` value the agent had while being a part of the cluster. * If all members are removed from the cluster, the cluster itself is converted back to a standalone Enterprise Agent too. Such standalone agent inherits the old clusters `agentId` value. The last `memberId` listed in the POST body inherits the clusters `agentId` value. **Example - removing a single member** ``` curl -X POST https://api.thousandeyes.com/v7/agents/64965/cluster/unassign \\ '{\"members\":[\"55974\"]}' \\ -H \"content-type:application/json\" \\ -H \"Authorization: Bearer $Bearer_token\" ``` **Example - removing multiple members** ``` curl https://api.thousandeyes.com/v7/agents/64965/cluster/unassign \\ '{\"members\":[ \"55974\", \"12313\"] }' \\ -H \"content-type:application/json\" \\ -H \"Authorization: Bearer $Bearer_token\" ```
:param agent_id: Unique ID for the Enterprise Agent cluster to remove agents from. (required)
:type agent_id: str
:param unassign_enterprise_agent_from_cluster_request: (required)
:type unassign_enterprise_agent_from_cluster_request: UnassignEnterpriseAgentFromClusterRequest
: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 expand: Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.
:type expand: List[AgentDetailsExpand]
: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._unassign_enterprise_agent_from_cluster_serialize(
agent_id=agent_id,
unassign_enterprise_agent_from_cluster_request=unassign_enterprise_agent_from_cluster_request,
aid=aid,
expand=expand,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgents200Response",
'400': "Error",
'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,
)
@validate_call
def unassign_enterprise_agent_from_cluster_without_preload_content(
self,
agent_id: Annotated[StrictStr, Field(description="Unique ID for the Enterprise Agent cluster to remove agents from.")],
unassign_enterprise_agent_from_cluster_request: UnassignEnterpriseAgentFromClusterRequest,
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,
expand: Annotated[Optional[List[AgentDetailsExpand]], Field(description="Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.")] = 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:
"""Remove member from Enterprise Agent cluster
Converts a cluster with a single or multiple Enterprise Agent members back to a standalone Enterprise Agent(s). This endpoint can also be used to remove one or more members from an Enterprise Agent cluster. Removed members revert to being standalone Enterprise Agents. If all members are removed from the cluster, the Enterprise Agent Cluster is deleted. The response is an list of agents, containing both the Enterprise Agent Cluster (if it still exists), and the removed members, now as standalone Enterprise Agents. This endpoint is exclusive to Enterprise Agent clusters and can be accessed only by users with the `Edit agents in account group` permission. On successful completion, the response contains the following information: * The updated cluster information is provided in the response body, unless all members are removed from the cluster. * Information about each removed member, now a standalone agent. * When a non-last member is removed from the cluster, it receives a new `agentId` value. This new `agentId` is different from the `agentId` the agent had before joining the cluster, and it is also unrelated to the `memberId` value the agent had while being a part of the cluster. * If all members are removed from the cluster, the cluster itself is converted back to a standalone Enterprise Agent too. Such standalone agent inherits the old clusters `agentId` value. The last `memberId` listed in the POST body inherits the clusters `agentId` value. **Example - removing a single member** ``` curl -X POST https://api.thousandeyes.com/v7/agents/64965/cluster/unassign \\ '{\"members\":[\"55974\"]}' \\ -H \"content-type:application/json\" \\ -H \"Authorization: Bearer $Bearer_token\" ``` **Example - removing multiple members** ``` curl https://api.thousandeyes.com/v7/agents/64965/cluster/unassign \\ '{\"members\":[ \"55974\", \"12313\"] }' \\ -H \"content-type:application/json\" \\ -H \"Authorization: Bearer $Bearer_token\" ```
:param agent_id: Unique ID for the Enterprise Agent cluster to remove agents from. (required)
:type agent_id: str
:param unassign_enterprise_agent_from_cluster_request: (required)
:type unassign_enterprise_agent_from_cluster_request: UnassignEnterpriseAgentFromClusterRequest
: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 expand: Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query.
:type expand: List[AgentDetailsExpand]
: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._unassign_enterprise_agent_from_cluster_serialize(
agent_id=agent_id,
unassign_enterprise_agent_from_cluster_request=unassign_enterprise_agent_from_cluster_request,
aid=aid,
expand=expand,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgents200Response",
'400': "Error",
'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 _unassign_enterprise_agent_from_cluster_serialize(
self,
agent_id,
unassign_enterprise_agent_from_cluster_request,
aid,
expand,
_request_auth,
_content_type,
_headers,
_host_index,
) -> Tuple:
_host = None
_collection_formats: Dict[str, str] = {
'expand': 'csv',
}
_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
if agent_id is not None:
_path_params['agentId'] = agent_id
# process the query parameters
if aid is not None:
_query_params.append(('aid', aid))
if expand is not None:
_query_params.append(('expand', expand))
# process the header parameters
# process the form parameters
# process the body parameter
if unassign_enterprise_agent_from_cluster_request is not None:
_body_params = unassign_enterprise_agent_from_cluster_request
# set the HTTP header `Accept`
_header_params['Accept'] = self.api_client.select_header_accept(
[
'application/hal+json',
'application/problem+json'
]
)
# set the HTTP header `Content-Type`
if _content_type:
_header_params['Content-Type'] = _content_type
else:
_default_content_type = (
self.api_client.select_header_content_type(
[
'application/json'
]
)
)
if _default_content_type is not None:
_header_params['Content-Type'] = _default_content_type
# authentication setting
_auth_settings: List[str] = [
'BearerAuth'
]
return self.api_client.param_serialize(
method='POST',
resource_path='/v7/agents/{agentId}/cluster/unassign',
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
)

View File

@ -0,0 +1,335 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import io
import warnings
from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
from typing import Dict, List, Optional, Tuple, Union, Any
try:
from typing import Annotated
except ImportError:
from typing_extensions import Annotated
from pydantic import Field
from typing_extensions import Annotated
from pydantic import StrictStr
from typing import Optional
from agents_api.models.get_agent_proxies200_response import GetAgentProxies200Response
from agents_api.api_client import ApiClient
from agents_api.api_response import ApiResponse
from agents_api.rest import RESTResponseType
class ProxiesApi:
"""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()
self.api_client = api_client
@validate_call
def get_agent_proxies(
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,
_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,
) -> GetAgentProxies200Response:
"""List agent proxies
List all agent proxies available under the account group.
: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_agent_proxies_serialize(
aid=aid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgentProxies200Response",
'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,
).data
@validate_call
def get_agent_proxies_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,
_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[GetAgentProxies200Response]:
"""List agent proxies
List all agent proxies available under the account group.
: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_agent_proxies_serialize(
aid=aid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgentProxies200Response",
'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,
)
@validate_call
def get_agent_proxies_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,
_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 agent proxies
List all agent proxies available under the account group.
: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_agent_proxies_serialize(
aid=aid,
_request_auth=_request_auth,
_content_type=_content_type,
_headers=_headers,
_host_index=_host_index
)
_response_types_map: Dict[str, Optional[str]] = {
'200': "GetAgentProxies200Response",
'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_agent_proxies_serialize(
self,
aid,
_request_auth,
_content_type,
_headers,
_host_index,
) -> Tuple:
_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, str] = {}
_body_params: Optional[bytes] = None
# process the path parameters
# 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/problem+json'
]
)
# authentication setting
_auth_settings: List[str] = [
'BearerAuth'
]
return self.api_client.param_serialize(
method='GET',
resource_path='/v7/agents/proxies',
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
)

View File

@ -0,0 +1,741 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import atexit
import datetime
from dateutil.parser import parse
import json
import mimetypes
import os
import re
import tempfile
from urllib.parse import quote
from typing import Tuple, Optional, List
from agents_api.configuration import Configuration
from agents_api.api_response import ApiResponse
import agents_api.models
from agents_api import rest
from agents_api.exceptions import (
ApiValueError,
ApiException,
BadRequestException,
UnauthorizedException,
ForbiddenException,
NotFoundException,
ServiceException
)
class ApiClient:
"""Generic API client for OpenAPI client library builds.
OpenAPI generic API client. This client handles the client-
server communication, and is invariant across implementations. Specifics of
the methods and models for each application are generated from the OpenAPI
templates.
:param configuration: .Configuration object for this client
:param header_name: a header to pass when making calls to the API.
:param header_value: a header value to pass when making calls to
the API.
:param cookie: a cookie to include in the header when making calls
to the API
"""
PRIMITIVE_TYPES = (float, bool, bytes, str, int)
NATIVE_TYPES_MAPPING = {
'int': int,
'long': int, # TODO remove as only py3 is supported?
'float': float,
'str': str,
'bool': bool,
'date': datetime.date,
'datetime': datetime.datetime,
'object': object,
}
_pool = None
def __init__(
self,
configuration=None,
header_name=None,
header_value=None,
cookie=None
) -> None:
# use default configuration if none is provided
if configuration is None:
configuration = Configuration.get_default()
self.configuration = configuration
self.rest_client = rest.RESTClientObject(configuration)
self.default_headers = {}
if header_name is not None:
self.default_headers[header_name] = header_value
self.cookie = cookie
# Set default User-Agent.
self.user_agent = 'ThousandEyes Python SDK'
self.client_side_validation = configuration.client_side_validation
def __enter__(self):
return self
def __exit__(self, exc_type, exc_value, traceback):
pass
@property
def user_agent(self):
"""User agent for this API client"""
return self.default_headers['User-Agent']
@user_agent.setter
def user_agent(self, value):
self.default_headers['User-Agent'] = value
def set_default_header(self, header_name, header_value):
self.default_headers[header_name] = header_value
_default = None
@classmethod
def get_default(cls):
"""Return new instance of ApiClient.
This method returns newly created, based on default constructor,
object of ApiClient class or returns a copy of default
ApiClient.
:return: The ApiClient object.
"""
if cls._default is None:
cls._default = ApiClient()
return cls._default
@classmethod
def set_default(cls, default):
"""Set default instance of ApiClient.
It stores default ApiClient.
:param default: object of ApiClient.
"""
cls._default = default
def param_serialize(
self,
method,
resource_path,
path_params=None,
query_params=None,
header_params=None,
body=None,
post_params=None,
files=None, auth_settings=None,
collection_formats=None,
_host=None,
_request_auth=None
) -> Tuple:
"""Builds the HTTP request params needed by the request.
:param method: Method to call.
:param resource_path: Path to method endpoint.
:param path_params: Path parameters in the url.
:param query_params: Query parameters in the url.
:param header_params: Header parameters to be
placed in the request header.
:param body: Request body.
:param post_params dict: Request post form parameters,
for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param auth_settings list: Auth Settings names for the request.
:param files dict: key -> filename, value -> filepath,
for `multipart/form-data`.
:param collection_formats: dict of collection formats for path, query,
header, and post parameters.
: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.
:return: tuple of form (path, http_method, query_params, header_params,
body, post_params, files)
"""
config = self.configuration
# header parameters
header_params = header_params or {}
header_params.update(self.default_headers)
if self.cookie:
header_params['Cookie'] = self.cookie
if header_params:
header_params = self.sanitize_for_serialization(header_params)
header_params = dict(
self.parameters_to_tuples(header_params,collection_formats)
)
# path parameters
if path_params:
path_params = self.sanitize_for_serialization(path_params)
path_params = self.parameters_to_tuples(
path_params,
collection_formats
)
for k, v in path_params:
# specified safe chars, encode everything
resource_path = resource_path.replace(
'{%s}' % k,
quote(str(v), safe=config.safe_chars_for_path_param)
)
# post parameters
if post_params or files:
post_params = post_params if post_params else []
post_params = self.sanitize_for_serialization(post_params)
post_params = self.parameters_to_tuples(
post_params,
collection_formats
)
post_params.extend(self.files_parameters(files))
# auth setting
self.update_params_for_auth(
header_params,
query_params,
auth_settings,
resource_path,
method,
body,
request_auth=_request_auth
)
# body
if body:
body = self.sanitize_for_serialization(body)
# request url
if _host is None:
url = self.configuration.host + resource_path
else:
# use server/host defined in path or operation instead
url = _host + resource_path
# query parameters
if query_params:
query_params = self.sanitize_for_serialization(query_params)
url_query = self.parameters_to_url_query(
query_params,
collection_formats
)
url += "?" + url_query
return method, url, header_params, body, post_params
def call_api(
self,
method,
url,
header_params=None,
body=None,
post_params=None,
_request_timeout=None
) -> rest.RESTResponse:
"""Makes the HTTP request (synchronous)
:param method: Method to call.
:param url: Path to method endpoint.
:param header_params: Header parameters to be
placed in the request header.
:param body: Request body.
:param post_params dict: Request post form parameters,
for `application/x-www-form-urlencoded`, `multipart/form-data`.
:param _request_timeout: timeout setting for this request.
:return: RESTResponse
"""
try:
# perform request and return response
response_data = self.rest_client.request(
method, url,
headers=header_params,
body=body, post_params=post_params,
_request_timeout=_request_timeout
)
except ApiException as e:
if e.body:
e.body = e.body.decode('utf-8')
raise e
return response_data
def response_deserialize(
self,
response_data=None,
response_types_map=None
) -> ApiResponse:
"""Deserializes response into an object.
:param response_data: RESTResponse object to be deserialized.
:param response_types_map: dict of response types.
:return: ApiResponse
"""
response_type = response_types_map.get(str(response_data.status), None)
if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599:
# if not found, look for '1XX', '2XX', etc.
response_type = response_types_map.get(str(response_data.status)[0] + "XX", None)
if not 200 <= response_data.status <= 299:
if response_data.status == 400:
raise BadRequestException(http_resp=response_data)
if response_data.status == 401:
raise UnauthorizedException(http_resp=response_data)
if response_data.status == 403:
raise ForbiddenException(http_resp=response_data)
if response_data.status == 404:
raise NotFoundException(http_resp=response_data)
if 500 <= response_data.status <= 599:
raise ServiceException(http_resp=response_data)
raise ApiException(http_resp=response_data)
# deserialize response data
if response_type == "bytearray":
return_data = response_data.data
elif response_type is None:
return_data = None
elif response_type == "file":
return_data = self.__deserialize_file(response_data)
else:
match = None
content_type = response_data.getheader('content-type')
if content_type is not None:
match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type)
encoding = match.group(1) if match else "utf-8"
response_text = response_data.data.decode(encoding)
return_data = self.deserialize(response_text, response_type)
return ApiResponse(
status_code = response_data.status,
data = return_data,
headers = response_data.getheaders(),
raw_data = response_data.data
)
def sanitize_for_serialization(self, obj):
"""Builds a JSON POST object.
If obj is None, return None.
If obj is str, int, long, float, bool, return directly.
If obj is datetime.datetime, datetime.date
convert to string in iso8601 format.
If obj is list, sanitize each element in the list.
If obj is dict, return the dict.
If obj is OpenAPI model, return the properties dict.
:param obj: The data to serialize.
:return: The serialized form of data.
"""
if obj is None:
return None
elif isinstance(obj, self.PRIMITIVE_TYPES):
return obj
elif isinstance(obj, list):
return [
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
]
elif isinstance(obj, tuple):
return tuple(
self.sanitize_for_serialization(sub_obj) for sub_obj in obj
)
elif isinstance(obj, (datetime.datetime, datetime.date)):
return obj.isoformat()
elif isinstance(obj, dict):
obj_dict = obj
else:
# Convert model obj to dict except
# attributes `openapi_types`, `attribute_map`
# and attributes which value is not None.
# Convert attribute name to json key in
# model definition for request.
obj_dict = obj.to_dict()
return {
key: self.sanitize_for_serialization(val)
for key, val in obj_dict.items()
}
def deserialize(self, response_text, response_type):
"""Deserializes response into an object.
:param response: RESTResponse object to be deserialized.
:param response_type: class literal for
deserialized object, or string of class name.
:return: deserialized object.
"""
# fetch data from response object
try:
data = json.loads(response_text)
except ValueError:
data = response_text
return self.__deserialize(data, response_type)
def __deserialize(self, data, klass):
"""Deserializes dict, list, str into an object.
:param data: dict, list or str.
:param klass: class literal, or string of class name.
:return: object.
"""
if data is None:
return None
if isinstance(klass, str):
if klass.startswith('List['):
sub_kls = re.match(r'List\[(.*)]', klass).group(1)
return [self.__deserialize(sub_data, sub_kls)
for sub_data in data]
if klass.startswith('Dict['):
sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2)
return {k: self.__deserialize(v, sub_kls)
for k, v in data.items()}
# convert str to class
if klass in self.NATIVE_TYPES_MAPPING:
klass = self.NATIVE_TYPES_MAPPING[klass]
else:
klass = getattr(agents_api.models, klass)
if klass in self.PRIMITIVE_TYPES:
return self.__deserialize_primitive(data, klass)
elif klass == object:
return self.__deserialize_object(data)
elif klass == datetime.date:
return self.__deserialize_date(data)
elif klass == datetime.datetime:
return self.__deserialize_datetime(data)
else:
return self.__deserialize_model(data, klass)
def parameters_to_tuples(self, params, collection_formats):
"""Get parameters as list of tuples, formatting collections.
:param params: Parameters as dict or list of two-tuples
:param dict collection_formats: Parameter collection formats
:return: Parameters as list of tuples, collections formatted
"""
new_params = []
if collection_formats is None:
collection_formats = {}
for k, v in params.items() if isinstance(params, dict) else params:
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
new_params.extend((k, value) for value in v)
else:
if collection_format == 'ssv':
delimiter = ' '
elif collection_format == 'tsv':
delimiter = '\t'
elif collection_format == 'pipes':
delimiter = '|'
else: # csv is the default
delimiter = ','
new_params.append(
(k, delimiter.join(str(value) for value in v)))
else:
new_params.append((k, v))
return new_params
def parameters_to_url_query(self, params, collection_formats):
"""Get parameters as list of tuples, formatting collections.
:param params: Parameters as dict or list of two-tuples
:param dict collection_formats: Parameter collection formats
:return: URL query string (e.g. a=Hello%20World&b=123)
"""
new_params = []
if collection_formats is None:
collection_formats = {}
for k, v in params.items() if isinstance(params, dict) else params:
if isinstance(v, bool):
v = str(v).lower()
if isinstance(v, (int, float)):
v = str(v)
if isinstance(v, dict):
v = json.dumps(v)
if k in collection_formats:
collection_format = collection_formats[k]
if collection_format == 'multi':
new_params.extend((k, value) for value in v)
else:
if collection_format == 'ssv':
delimiter = ' '
elif collection_format == 'tsv':
delimiter = '\t'
elif collection_format == 'pipes':
delimiter = '|'
else: # csv is the default
delimiter = ','
new_params.append(
(k, delimiter.join(quote(str(value)) for value in v))
)
else:
new_params.append((k, quote(str(v))))
return "&".join(["=".join(item) for item in new_params])
def files_parameters(self, files=None):
"""Builds form parameters.
:param files: File parameters.
:return: Form parameters with files.
"""
params = []
if files:
for k, v in files.items():
if not v:
continue
file_names = v if type(v) is list else [v]
for n in file_names:
with open(n, 'rb') as f:
filename = os.path.basename(f.name)
filedata = f.read()
mimetype = (
mimetypes.guess_type(filename)[0]
or 'application/octet-stream'
)
params.append(
tuple([k, tuple([filename, filedata, mimetype])])
)
return params
def select_header_accept(self, accepts: List[str]) -> Optional[str]:
"""Returns `Accept` based on an array of accepts provided.
:param accepts: List of headers.
:return: Accept (e.g. application/json).
"""
if not accepts:
return None
for accept in accepts:
if re.search('json', accept, re.IGNORECASE):
return accept
return accepts[0]
def select_header_content_type(self, content_types):
"""Returns `Content-Type` based on an array of content_types provided.
:param content_types: List of content-types.
:return: Content-Type (e.g. application/json).
"""
if not content_types:
return None
for content_type in content_types:
if re.search('json', content_type, re.IGNORECASE):
return content_type
return content_types[0]
def update_params_for_auth(
self,
headers,
queries,
auth_settings,
resource_path,
method,
body,
request_auth=None
) -> None:
"""Updates header and query params based on authentication setting.
:param headers: Header parameters dict to be updated.
:param queries: Query parameters tuple list to be updated.
:param auth_settings: Authentication setting identifiers list.
:resource_path: A string representation of the HTTP request resource path.
:method: A string representation of the HTTP request method.
:body: A object representing the body of the HTTP request.
The object type is the return value of sanitize_for_serialization().
:param request_auth: if set, the provided settings will
override the token in the configuration.
"""
if not auth_settings:
return
if request_auth:
self._apply_auth_params(
headers,
queries,
resource_path,
method,
body,
request_auth
)
else:
for auth in auth_settings:
auth_setting = self.configuration.auth_settings().get(auth)
if auth_setting:
self._apply_auth_params(
headers,
queries,
resource_path,
method,
body,
auth_setting
)
def _apply_auth_params(
self,
headers,
queries,
resource_path,
method,
body,
auth_setting
) -> None:
"""Updates the request parameters based on a single auth_setting
:param headers: Header parameters dict to be updated.
:param queries: Query parameters tuple list to be updated.
:resource_path: A string representation of the HTTP request resource path.
:method: A string representation of the HTTP request method.
:body: A object representing the body of the HTTP request.
The object type is the return value of sanitize_for_serialization().
:param auth_setting: auth settings for the endpoint
"""
if auth_setting['in'] == 'cookie':
headers['Cookie'] = auth_setting['value']
elif auth_setting['in'] == 'header':
if auth_setting['type'] != 'http-signature':
headers[auth_setting['key']] = auth_setting['value']
elif auth_setting['in'] == 'query':
queries.append((auth_setting['key'], auth_setting['value']))
else:
raise ApiValueError(
'Authentication token must be in `query` or `header`'
)
def __deserialize_file(self, response):
"""Deserializes body to file
Saves response body into a file in a temporary folder,
using the filename from the `Content-Disposition` header if provided.
handle file downloading
save response body into a tmp file and return the instance
:param response: RESTResponse.
:return: file path.
"""
fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path)
os.close(fd)
os.remove(path)
content_disposition = response.getheader("Content-Disposition")
if content_disposition:
filename = re.search(
r'filename=[\'"]?([^\'"\s]+)[\'"]?',
content_disposition
).group(1)
path = os.path.join(os.path.dirname(path), filename)
with open(path, "wb") as f:
f.write(response.data)
return path
def __deserialize_primitive(self, data, klass):
"""Deserializes string to primitive type.
:param data: str.
:param klass: class literal.
:return: int, long, float, str, bool.
"""
try:
return klass(data)
except UnicodeEncodeError:
return str(data)
except TypeError:
return data
def __deserialize_object(self, value):
"""Return an original value.
:return: object.
"""
return value
def __deserialize_date(self, string):
"""Deserializes string to date.
:param string: str.
:return: date.
"""
try:
return parse(string).date()
except ImportError:
return string
except ValueError:
raise rest.ApiException(
status=0,
reason="Failed to parse `{0}` as date object".format(string)
)
def __deserialize_datetime(self, string):
"""Deserializes string to datetime.
The string should be in iso8601 datetime format.
:param string: str.
:return: datetime.
"""
try:
return parse(string)
except ImportError:
return string
except ValueError:
raise rest.ApiException(
status=0,
reason=(
"Failed to parse `{0}` as datetime object"
.format(string)
)
)
def __deserialize_model(self, data, klass):
"""Deserializes list or dict to model.
:param data: dict, list.
:param klass: class literal.
:return: model object.
"""
return klass.from_dict(data)

View File

@ -0,0 +1,21 @@
"""API response object."""
from __future__ import annotations
from typing import Any, Dict, Optional, Generic, TypeVar
from pydantic import Field, StrictInt, StrictStr, StrictBytes, BaseModel
T = TypeVar("T")
class ApiResponse(BaseModel, Generic[T]):
"""
API response object
"""
status_code: StrictInt = Field(description="HTTP status code")
headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers")
data: T = Field(description="Deserialized data given the data type")
raw_data: StrictBytes = Field(description="Raw data (HTTP response body)")
model_config = {
"arbitrary_types_allowed": True
}

View File

@ -0,0 +1,434 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import copy
import logging
import sys
import urllib3
import http.client as httplib
JSON_SCHEMA_VALIDATION_KEYWORDS = {
'multipleOf', 'maximum', 'exclusiveMaximum',
'minimum', 'exclusiveMinimum', 'maxLength',
'minLength', 'pattern', 'maxItems', 'minItems'
}
class Configuration:
"""This class contains various settings of the API client.
:param host: Base url.
:param api_key: Dict to store API key(s).
Each entry in the dict specifies an API key.
The dict key is the name of the security scheme in the OAS specification.
The dict value is the API key secret.
:param api_key_prefix: Dict to store API prefix (e.g. Bearer).
The dict key is the name of the security scheme in the OAS specification.
The dict value is an API key prefix when generating the auth data.
:param username: Username for HTTP basic authentication.
:param password: Password for HTTP basic authentication.
:param access_token: Access token.
:param server_index: Index to servers configuration.
:param server_variables: Mapping with string values to replace variables in
templated server configuration. The validation of enums is performed for
variables with defined enum values before.
:param server_operation_index: Mapping from operation ID to an index to server
configuration.
:param server_operation_variables: Mapping from operation ID to a mapping with
string values to replace variables in templated server configuration.
The validation of enums is performed for variables with defined enum
values before.
:param ssl_ca_cert: str - the path to a file of concatenated CA certificates
in PEM format.
:Example:
"""
_default = None
def __init__(self, host=None,
api_key=None, api_key_prefix=None,
username=None, password=None,
access_token=None,
server_index=None, server_variables=None,
server_operation_index=None, server_operation_variables=None,
ssl_ca_cert=None,
) -> None:
"""Constructor
"""
self._base_path = "https://api.thousandeyes.com" if host is None else host
"""Default Base url
"""
self.server_index = 0 if server_index is None and host is None else server_index
self.server_operation_index = server_operation_index or {}
"""Default server index
"""
self.server_variables = server_variables or {}
self.server_operation_variables = server_operation_variables or {}
"""Default server variables
"""
self.temp_folder_path = None
"""Temp file folder for downloading files
"""
# Authentication Settings
self.api_key = {}
if api_key:
self.api_key = api_key
"""dict to store API key(s)
"""
self.api_key_prefix = {}
if api_key_prefix:
self.api_key_prefix = api_key_prefix
"""dict to store API prefix (e.g. Bearer)
"""
self.refresh_api_key_hook = None
"""function hook to refresh API key if expired
"""
self.username = username
"""Username for HTTP basic authentication
"""
self.password = password
"""Password for HTTP basic authentication
"""
self.access_token = access_token
"""Access token
"""
self.logger = {}
"""Logging Settings
"""
self.logger["package_logger"] = logging.getLogger("agents_api")
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
"""Log format
"""
self.logger_stream_handler = None
"""Log stream handler
"""
self.logger_file_handler = None
"""Log file handler
"""
self.logger_file = None
"""Debug file location
"""
self.debug = False
"""Debug switch
"""
self.verify_ssl = True
"""SSL/TLS verification
Set this to false to skip verifying SSL certificate when calling API
from https server.
"""
self.ssl_ca_cert = ssl_ca_cert
"""Set this to customize the certificate file to verify the peer.
"""
self.cert_file = None
"""client certificate file
"""
self.key_file = None
"""client key file
"""
self.assert_hostname = None
"""Set this to True/False to enable/disable SSL hostname verification.
"""
self.tls_server_name = None
"""SSL/TLS Server Name Indication (SNI)
Set this to the SNI value expected by the server.
"""
self.proxy = None
"""Proxy URL
"""
self.proxy_headers = None
"""Proxy headers
"""
self.safe_chars_for_path_param = ''
"""Safe chars for path_param
"""
self.retries = None
"""Adding retries to override urllib3 default value 3
"""
# Enable client side validation
self.client_side_validation = True
self.socket_options = None
"""Options to pass down to the underlying urllib3 socket
"""
self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z"
"""datetime format
"""
self.date_format = "%Y-%m-%d"
"""date format
"""
def __deepcopy__(self, memo):
cls = self.__class__
result = cls.__new__(cls)
memo[id(self)] = result
for k, v in self.__dict__.items():
if k not in ('logger', 'logger_file_handler'):
setattr(result, k, copy.deepcopy(v, memo))
# shallow copy of loggers
result.logger = copy.copy(self.logger)
# use setters to configure loggers
result.logger_file = self.logger_file
result.debug = self.debug
return result
def __setattr__(self, name, value):
object.__setattr__(self, name, value)
@classmethod
def set_default(cls, default):
"""Set default instance of configuration.
It stores default configuration, which can be
returned by get_default_copy method.
:param default: object of Configuration
"""
cls._default = default
@classmethod
def get_default_copy(cls):
"""Deprecated. Please use `get_default` instead.
Deprecated. Please use `get_default` instead.
:return: The configuration object.
"""
return cls.get_default()
@classmethod
def get_default(cls):
"""Return the default configuration.
This method returns newly created, based on default constructor,
object of Configuration class or returns a copy of default
configuration.
:return: The configuration object.
"""
if cls._default is None:
cls._default = Configuration()
return cls._default
@property
def logger_file(self):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
return self.__logger_file
@logger_file.setter
def logger_file(self, value):
"""The logger file.
If the logger_file is None, then add stream handler and remove file
handler. Otherwise, add file handler and remove stream handler.
:param value: The logger_file path.
:type: str
"""
self.__logger_file = value
if self.__logger_file:
# If set logging file,
# then add file handler and remove stream handler.
self.logger_file_handler = logging.FileHandler(self.__logger_file)
self.logger_file_handler.setFormatter(self.logger_formatter)
for _, logger in self.logger.items():
logger.addHandler(self.logger_file_handler)
@property
def debug(self):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
return self.__debug
@debug.setter
def debug(self, value):
"""Debug status
:param value: The debug status, True or False.
:type: bool
"""
self.__debug = value
if self.__debug:
# if debug status is True, turn on debug logging
for _, logger in self.logger.items():
logger.setLevel(logging.DEBUG)
# turn on httplib debug
httplib.HTTPConnection.debuglevel = 1
else:
# if debug status is False, turn off debug logging,
# setting log level to default `logging.WARNING`
for _, logger in self.logger.items():
logger.setLevel(logging.WARNING)
# turn off httplib debug
httplib.HTTPConnection.debuglevel = 0
@property
def logger_format(self):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
return self.__logger_format
@logger_format.setter
def logger_format(self, value):
"""The logger format.
The logger_formatter will be updated when sets logger_format.
:param value: The format string.
:type: str
"""
self.__logger_format = value
self.logger_formatter = logging.Formatter(self.__logger_format)
def get_api_key_with_prefix(self, identifier, alias=None):
"""Gets API key (with prefix if set).
:param identifier: The identifier of apiKey.
:param alias: The alternative identifier of apiKey.
:return: The token for api key authentication.
"""
if self.refresh_api_key_hook is not None:
self.refresh_api_key_hook(self)
key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None)
if key:
prefix = self.api_key_prefix.get(identifier)
if prefix:
return "%s %s" % (prefix, key)
else:
return key
def get_basic_auth_token(self):
"""Gets HTTP basic authentication header (string).
:return: The token for basic HTTP authentication.
"""
username = ""
if self.username is not None:
username = self.username
password = ""
if self.password is not None:
password = self.password
return urllib3.util.make_headers(
basic_auth=username + ':' + password
).get('authorization')
def auth_settings(self):
"""Gets Auth Settings dict for api client.
:return: The Auth Settings information dict.
"""
auth = {}
if self.access_token is not None:
auth['BearerAuth'] = {
'type': 'bearer',
'in': 'header',
'key': 'Authorization',
'value': 'Bearer ' + self.access_token
}
return auth
def to_debug_report(self):
"""Gets the essential information for debugging.
:return: The report for debugging.
"""
return "Python SDK Debug Report:\n"\
"OS: {env}\n"\
"Python Version: {pyversion}\n"\
"Version of the API: 7.0.0\n"\
"SDK Package Version: 1.0.0".\
format(env=sys.platform, pyversion=sys.version)
def get_host_settings(self):
"""Gets an array of host settings
:return: An array of host settings
"""
return [
{
'url': "https://api.thousandeyes.com",
'description': "Thousandeyes API production URL",
}
]
def get_host_from_settings(self, index, variables=None, servers=None):
"""Gets host URL based on the index and variables
:param index: array index of the host settings
:param variables: hash of variable and the corresponding value
:param servers: an array of host settings or None
:return: URL based on host settings
"""
if index is None:
return self._base_path
variables = {} if variables is None else variables
servers = self.get_host_settings() if servers is None else servers
try:
server = servers[index]
except IndexError:
raise ValueError(
"Invalid index {0} when selecting the host settings. "
"Must be less than {1}".format(index, len(servers)))
url = server['url']
# go through variables and replace placeholders
for variable_name, variable in server.get('variables', {}).items():
used_value = variables.get(
variable_name, variable['default_value'])
if 'enum_values' in variable \
and used_value not in variable['enum_values']:
raise ValueError(
"The variable `{0}` in the host URL has invalid value "
"{1}. Must be {2}.".format(
variable_name, variables[variable_name],
variable['enum_values']))
url = url.replace("{" + variable_name + "}", used_value)
return url
@property
def host(self):
"""Return generated host."""
return self.get_host_from_settings(self.server_index, variables=self.server_variables)
@host.setter
def host(self, value):
"""Fix base path."""
self._base_path = value
self.server_index = None

View File

@ -0,0 +1,166 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
class OpenApiException(Exception):
"""The base exception class for all OpenAPIExceptions"""
class ApiTypeError(OpenApiException, TypeError):
def __init__(self, msg, path_to_item=None, valid_classes=None,
key_type=None) -> None:
""" Raises an exception for TypeErrors
Args:
msg (str): the exception message
Keyword Args:
path_to_item (list): a list of keys an indices to get to the
current_item
None if unset
valid_classes (tuple): the primitive classes that current item
should be an instance of
None if unset
key_type (bool): False if our value is a value in a dict
True if it is a key in a dict
False if our item is an item in a list
None if unset
"""
self.path_to_item = path_to_item
self.valid_classes = valid_classes
self.key_type = key_type
full_msg = msg
if path_to_item:
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
super(ApiTypeError, self).__init__(full_msg)
class ApiValueError(OpenApiException, ValueError):
def __init__(self, msg, path_to_item=None) -> None:
"""
Args:
msg (str): the exception message
Keyword Args:
path_to_item (list) the path to the exception in the
received_data dict. None if unset
"""
self.path_to_item = path_to_item
full_msg = msg
if path_to_item:
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
super(ApiValueError, self).__init__(full_msg)
class ApiAttributeError(OpenApiException, AttributeError):
def __init__(self, msg, path_to_item=None) -> None:
"""
Raised when an attribute reference or assignment fails.
Args:
msg (str): the exception message
Keyword Args:
path_to_item (None/list) the path to the exception in the
received_data dict
"""
self.path_to_item = path_to_item
full_msg = msg
if path_to_item:
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
super(ApiAttributeError, self).__init__(full_msg)
class ApiKeyError(OpenApiException, KeyError):
def __init__(self, msg, path_to_item=None) -> None:
"""
Args:
msg (str): the exception message
Keyword Args:
path_to_item (None/list) the path to the exception in the
received_data dict
"""
self.path_to_item = path_to_item
full_msg = msg
if path_to_item:
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
super(ApiKeyError, self).__init__(full_msg)
class ApiException(OpenApiException):
def __init__(self, status=None, reason=None, http_resp=None) -> None:
if http_resp:
self.status = http_resp.status
self.reason = http_resp.reason
self.body = http_resp.data.decode('utf-8')
self.headers = http_resp.getheaders()
else:
self.status = status
self.reason = reason
self.body = None
self.headers = None
def __str__(self):
"""Custom error messages for exception"""
error_message = "({0})\n"\
"Reason: {1}\n".format(self.status, self.reason)
if self.headers:
error_message += "HTTP response headers: {0}\n".format(
self.headers)
if self.body:
error_message += "HTTP response body: {0}\n".format(self.body)
return error_message
class BadRequestException(ApiException):
def __init__(self, status=None, reason=None, http_resp=None) -> None:
super(BadRequestException, self).__init__(status, reason, http_resp)
class NotFoundException(ApiException):
def __init__(self, status=None, reason=None, http_resp=None) -> None:
super(NotFoundException, self).__init__(status, reason, http_resp)
class UnauthorizedException(ApiException):
def __init__(self, status=None, reason=None, http_resp=None) -> None:
super(UnauthorizedException, self).__init__(status, reason, http_resp)
class ForbiddenException(ApiException):
def __init__(self, status=None, reason=None, http_resp=None) -> None:
super(ForbiddenException, self).__init__(status, reason, http_resp)
class ServiceException(ApiException):
def __init__(self, status=None, reason=None, http_resp=None) -> None:
super(ServiceException, self).__init__(status, reason, http_resp)
def render_path(path_to_item):
"""Returns a string representation of a path"""
result = ""
for pth in path_to_item:
if isinstance(pth, int):
result += "[{0}]".format(pth)
else:
result += "['{0}']".format(pth)
return result

View File

@ -0,0 +1,72 @@
# coding: utf-8
# flake8: noqa
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
# import models into model package
from agents_api.models.account_group import AccountGroup
from agents_api.models.account_group_id import AccountGroupId
from agents_api.models.agent import Agent
from agents_api.models.agent_base import AgentBase
from agents_api.models.agent_detail import AgentDetail
from agents_api.models.agent_details import AgentDetails
from agents_api.models.agent_details_expand import AgentDetailsExpand
from agents_api.models.agent_ipv6_policy import AgentIpv6Policy
from agents_api.models.agent_list_expand import AgentListExpand
from agents_api.models.agent_proxies import AgentProxies
from agents_api.models.agent_proxy import AgentProxy
from agents_api.models.agents import Agents
from agents_api.models.alert_email import AlertEmail
from agents_api.models.alert_integration_base import AlertIntegrationBase
from agents_api.models.alert_integration_type import AlertIntegrationType
from agents_api.models.assign_enterprise_agent_cluster_request import AssignEnterpriseAgentClusterRequest
from agents_api.models.cloud_enterprise_agent import CloudEnterpriseAgent
from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
from agents_api.models.cloud_enterprise_agents import CloudEnterpriseAgents
from agents_api.models.cluster_member import ClusterMember
from agents_api.models.enterprise_agent import EnterpriseAgent
from agents_api.models.enterprise_agent_detail import EnterpriseAgentDetail
from agents_api.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy
from agents_api.models.enterprise_agent_request_body import EnterpriseAgentRequestBody
from agents_api.models.enterprise_agent_state import EnterpriseAgentState
from agents_api.models.error import Error
from agents_api.models.error_detail import ErrorDetail
from agents_api.models.error_detail_code import ErrorDetailCode
from agents_api.models.get_agent_details200_response import GetAgentDetails200Response
from agents_api.models.get_agent_proxies200_response import GetAgentProxies200Response
from agents_api.models.get_agents200_response import GetAgents200Response
from agents_api.models.get_agents_notification_rule200_response import GetAgentsNotificationRule200Response
from agents_api.models.get_agents_notification_rules200_response import GetAgentsNotificationRules200Response
from agents_api.models.interface_ip_mapping import InterfaceIpMapping
from agents_api.models.labels import Labels
from agents_api.models.link import Link
from agents_api.models.notification import Notification
from agents_api.models.notification_rule import NotificationRule
from agents_api.models.notification_rule_detail import NotificationRuleDetail
from agents_api.models.notification_rules import NotificationRules
from agents_api.models.notifications import Notifications
from agents_api.models.proxy_auth_type import ProxyAuthType
from agents_api.models.proxy_type import ProxyType
from agents_api.models.self_links import SelfLinks
from agents_api.models.self_links_links import SelfLinksLinks
from agents_api.models.simple_test import SimpleTest
from agents_api.models.test_interval import TestInterval
from agents_api.models.test_type import TestType
from agents_api.models.unassign_enterprise_agent_from_cluster_request import UnassignEnterpriseAgentFromClusterRequest
from agents_api.models.unauthorized_error import UnauthorizedError
from agents_api.models.unexpanded_instant_test import UnexpandedInstantTest
from agents_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks
from agents_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf
from agents_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults
from agents_api.models.unexpanded_test import UnexpandedTest
from agents_api.models.update_enterprise_agent_details200_response import UpdateEnterpriseAgentDetails200Response

View File

@ -0,0 +1,90 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AccountGroup(BaseModel):
"""
AccountGroup
""" # 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.")
account_group_name: Optional[StrictStr] = Field(default=None, description="Account group name", alias="accountGroupName")
__properties: ClassVar[List[str]] = ["aid", "accountGroupName"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AccountGroup 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of AccountGroup 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"),
"accountGroupName": obj.get("accountGroupName")
})
return _obj

View File

@ -0,0 +1,88 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AccountGroupId(BaseModel):
"""
AccountGroupId
""" # 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.")
__properties: ClassVar[List[str]] = ["aid"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AccountGroupId 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of AccountGroupId 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")
})
return _obj

View File

@ -0,0 +1,121 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictStr
from pydantic import Field
from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class Agent(BaseModel):
"""
Agent
""" # noqa: E501
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agents public IP.")
agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId")
agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName")
agent_type: Optional[CloudEnterpriseAgentType] = Field(default=None, alias="agentType")
location: Optional[StrictStr] = Field(default=None, description="Location of the agent.")
country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId")
enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.")
verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates")
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "agentType", "location", "countryId", "enabled", "verifySslCertificates"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of Agent 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.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"ip_addresses",
"public_ip_addresses",
"network",
"agent_id",
"location",
"country_id",
"verify_ssl_certificates",
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of Agent from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ipAddresses": obj.get("ipAddresses"),
"publicIpAddresses": obj.get("publicIpAddresses"),
"network": obj.get("network"),
"agentId": obj.get("agentId"),
"agentName": obj.get("agentName"),
"agentType": obj.get("agentType"),
"location": obj.get("location"),
"countryId": obj.get("countryId"),
"enabled": obj.get("enabled"),
"verifySslCertificates": obj.get("verifySslCertificates")
})
return _obj

View File

@ -0,0 +1,98 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AgentBase(BaseModel):
"""
AgentBase
""" # noqa: E501
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agents public IP.")
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AgentBase 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"ip_addresses",
"public_ip_addresses",
"network",
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of AgentBase from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ipAddresses": obj.get("ipAddresses"),
"publicIpAddresses": obj.get("publicIpAddresses"),
"network": obj.get("network")
})
return _obj

View File

@ -0,0 +1,143 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictStr
from pydantic import Field
from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
from agents_api.models.labels import Labels
from agents_api.models.simple_test import SimpleTest
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AgentDetail(BaseModel):
"""
AgentDetail
""" # noqa: E501
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agents public IP.")
agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId")
agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName")
agent_type: Optional[CloudEnterpriseAgentType] = Field(default=None, alias="agentType")
location: Optional[StrictStr] = Field(default=None, description="Location of the agent.")
country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId")
enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.")
verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates")
tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.")
labels: Optional[List[Labels]] = Field(default=None, description="List of labels - see `/labels` for more information.")
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "agentType", "location", "countryId", "enabled", "verifySslCertificates", "tests", "labels"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AgentDetail 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.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"ip_addresses",
"public_ip_addresses",
"network",
"agent_id",
"location",
"country_id",
"verify_ssl_certificates",
"labels",
},
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
# override the default output from pydantic by calling `to_dict()` of each item in labels (list)
_items = []
if self.labels:
for _item in self.labels:
if _item:
_items.append(_item.to_dict())
_dict['labels'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of AgentDetail from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ipAddresses": obj.get("ipAddresses"),
"publicIpAddresses": obj.get("publicIpAddresses"),
"network": obj.get("network"),
"agentId": obj.get("agentId"),
"agentName": obj.get("agentName"),
"agentType": obj.get("agentType"),
"location": obj.get("location"),
"countryId": obj.get("countryId"),
"enabled": obj.get("enabled"),
"verifySslCertificates": obj.get("verifySslCertificates"),
"tests": [SimpleTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None,
"labels": [Labels.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None
})
return _obj

View File

@ -0,0 +1,145 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
from inspect import getfullargspec
import json
import pprint
import re # noqa: F401
from typing import Any, List, Optional
from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator
from agents_api.models.agent_detail import AgentDetail
from agents_api.models.enterprise_agent_detail import EnterpriseAgentDetail
from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal
from pydantic import StrictStr, Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
AGENTDETAILS_ONE_OF_SCHEMAS = ["AgentDetail", "EnterpriseAgentDetail"]
class AgentDetails(BaseModel):
"""
AgentDetails
"""
# data type: EnterpriseAgentDetail
oneof_schema_1_validator: Optional[EnterpriseAgentDetail] = None
# data type: AgentDetail
oneof_schema_2_validator: Optional[AgentDetail] = None
actual_instance: Optional[Union[AgentDetail, EnterpriseAgentDetail]] = None
one_of_schemas: List[str] = Literal["AgentDetail", "EnterpriseAgentDetail"]
model_config = {
"validate_assignment": True
}
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 = AgentDetails.model_construct()
error_messages = []
match = 0
# validate data type: EnterpriseAgentDetail
if not isinstance(v, EnterpriseAgentDetail):
error_messages.append(f"Error! Input type `{type(v)}` is not `EnterpriseAgentDetail`")
else:
match += 1
# validate data type: AgentDetail
if not isinstance(v, AgentDetail):
error_messages.append(f"Error! Input type `{type(v)}` is not `AgentDetail`")
else:
match += 1
if match > 1:
# more than 1 match
raise ValueError("Multiple matches found when setting `actual_instance` in AgentDetails with oneOf schemas: AgentDetail, EnterpriseAgentDetail. Details: " + ", ".join(error_messages))
elif match == 0:
# no match
raise ValueError("No match found when setting `actual_instance` in AgentDetails with oneOf schemas: AgentDetail, EnterpriseAgentDetail. Details: " + ", ".join(error_messages))
else:
return v
@classmethod
def from_dict(cls, obj: dict) -> 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 EnterpriseAgentDetail
try:
instance.actual_instance = EnterpriseAgentDetail.from_json(json_str)
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into AgentDetail
try:
instance.actual_instance = AgentDetail.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 AgentDetails with oneOf schemas: AgentDetail, EnterpriseAgentDetail. Details: " + ", ".join(error_messages))
elif match == 0:
# no match
raise ValueError("No match found when deserializing the JSON string into AgentDetails with oneOf schemas: AgentDetail, EnterpriseAgentDetail. Details: " + ", ".join(error_messages))
else:
return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
to_json = getattr(self.actual_instance, "to_json", None)
if callable(to_json):
return self.actual_instance.to_json()
else:
return json.dumps(self.actual_instance)
def to_dict(self) -> Dict:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
to_dict = getattr(self.actual_instance, "to_dict", None)
if callable(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())

View File

@ -0,0 +1,46 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AgentDetailsExpand(str, Enum):
"""
AgentDetailsExpand
"""
"""
allowed enum values
"""
CLUSTER_MINUS_MEMBER = 'cluster-member'
TEST = 'test'
NOTIFICATION_MINUS_RULE = 'notification-rule'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AgentDetailsExpand from a JSON string"""
return cls(json.loads(json_str))

View File

@ -0,0 +1,46 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AgentIpv6Policy(str, Enum):
"""
IP version policy, (Enterprise Agents and Enterprise Clusters only)
"""
"""
allowed enum values
"""
FORCE_MINUS_IPV4 = 'force-ipv4'
PREFER_MINUS_IPV6 = 'prefer-ipv6'
FORCE_MINUS_IPV6 = 'force-ipv6'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AgentIpv6Policy from a JSON string"""
return cls(json.loads(json_str))

View File

@ -0,0 +1,44 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AgentListExpand(str, Enum):
"""
AgentListExpand
"""
"""
allowed enum values
"""
CLUSTER_MINUS_MEMBER = 'cluster-member'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AgentListExpand from a JSON string"""
return cls(json.loads(json_str))

View File

@ -0,0 +1,96 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from pydantic import Field
from agents_api.models.agent_proxy import AgentProxy
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AgentProxies(BaseModel):
"""
AgentProxies
""" # noqa: E501
agent_proxies: Optional[List[AgentProxy]] = Field(default=None, alias="agentProxies")
__properties: ClassVar[List[str]] = ["agentProxies"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AgentProxies 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in agent_proxies (list)
_items = []
if self.agent_proxies:
for _item in self.agent_proxies:
if _item:
_items.append(_item.to_dict())
_dict['agentProxies'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of AgentProxies from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"agentProxies": [AgentProxy.from_dict(_item) for _item in obj.get("agentProxies")] if obj.get("agentProxies") is not None else None
})
return _obj

View File

@ -0,0 +1,110 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, SecretStr, StrictBool, StrictStr
from pydantic import Field
from agents_api.models.proxy_auth_type import ProxyAuthType
from agents_api.models.proxy_type import ProxyType
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AgentProxy(BaseModel):
"""
AgentProxy
""" # noqa: E501
aid: Optional[StrictStr] = Field(default=None, description="Account id that this proxy configuration belongs to")
auth_type: Optional[ProxyAuthType] = Field(default=None, alias="authType")
bypass_list: Optional[List[StrictStr]] = Field(default=None, description="A list of hostnames, network prefixes, or wildcards used to determine which test targets should not be proxied. If all tests should be proxied, leave empty.", alias="bypassList")
last_modified: Optional[datetime] = Field(default=None, description="Last modification timestamp of the proxy. Expressed in UTC (ISO date-time format).", alias="lastModified")
location: Optional[StrictStr] = Field(default=None, description="The location of the proxy. If proxyType is `static` use the format `hostname:port`. If location is `pac`, then specify the URL where the PAC file can be obtained.")
is_local_configured: Optional[StrictBool] = Field(default=None, description="Set to `true` if this proxy configuration comes from the agents config file. Specify `false` if the proxy configuration was created in the ThousandEyes application.", alias="isLocalConfigured")
name: Optional[StrictStr] = Field(default=None, description="Expression of agent notification rule.")
password: Optional[SecretStr] = Field(default=None, description="Password for proxy authentication")
proxy_id: Optional[StrictStr] = Field(default=None, description="Agent proxy's unique ID.", alias="proxyId")
type: Optional[ProxyType] = None
user: Optional[StrictStr] = Field(default=None, description="Username for proxy authentication.")
__properties: ClassVar[List[str]] = ["aid", "authType", "bypassList", "lastModified", "location", "isLocalConfigured", "name", "password", "proxyId", "type", "user"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AgentProxy 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of AgentProxy 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"),
"authType": obj.get("authType"),
"bypassList": obj.get("bypassList"),
"lastModified": obj.get("lastModified"),
"location": obj.get("location"),
"isLocalConfigured": obj.get("isLocalConfigured"),
"name": obj.get("name"),
"password": obj.get("password"),
"proxyId": obj.get("proxyId"),
"type": obj.get("type"),
"user": obj.get("user")
})
return _obj

View File

@ -0,0 +1,95 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from agents_api.models.agent import Agent
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class Agents(BaseModel):
"""
Agents
""" # noqa: E501
agents: Optional[List[Agent]] = None
__properties: ClassVar[List[str]] = ["agents"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of Agents 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
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: Dict) -> Self:
"""Create an instance of Agents from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None
})
return _obj

View File

@ -0,0 +1,90 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AlertEmail(BaseModel):
"""
AlertEmail
""" # noqa: E501
message: Optional[StrictStr] = Field(default=None, description="Message used for email notification.")
recipients: Optional[List[StrictStr]] = Field(default=None, description="List of recipients emails that will be notified.")
__properties: ClassVar[List[str]] = ["message", "recipients"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AlertEmail 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of AlertEmail from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"message": obj.get("message"),
"recipients": obj.get("recipients")
})
return _obj

View File

@ -0,0 +1,103 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
from agents_api.models.alert_integration_type import AlertIntegrationType
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AlertIntegrationBase(BaseModel):
"""
AlertIntegrationBase
""" # noqa: E501
integration_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the integration.", alias="integrationId")
integration_name: Optional[StrictStr] = Field(default=None, description="Name of the integration.", alias="integrationName")
integration_type: Optional[AlertIntegrationType] = Field(default=None, alias="integrationType")
target: Optional[StrictStr] = Field(default=None, description="Target URL of the integration.")
auth_method: Optional[StrictStr] = Field(default=None, description="(PagerDuty only) Authentication method.", alias="authMethod")
auth_user: Optional[StrictStr] = Field(default=None, description="(PagerDuty only) Authentication user.", alias="authUser")
auth_token: Optional[StrictStr] = Field(default=None, description="(PagerDuty only) Authentication token.", alias="authToken")
channel: Optional[StrictStr] = Field(default=None, description="(Slack only) Slack `#channel` or `@user`.")
__properties: ClassVar[List[str]] = ["integrationId", "integrationName", "integrationType", "target", "authMethod", "authUser", "authToken", "channel"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AlertIntegrationBase 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of AlertIntegrationBase from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"integrationId": obj.get("integrationId"),
"integrationName": obj.get("integrationName"),
"integrationType": obj.get("integrationType"),
"target": obj.get("target"),
"authMethod": obj.get("authMethod"),
"authUser": obj.get("authUser"),
"authToken": obj.get("authToken"),
"channel": obj.get("channel")
})
return _obj

View File

@ -0,0 +1,45 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AlertIntegrationType(str, Enum):
"""
Type of the alert integration
"""
"""
allowed enum values
"""
PAGER_MINUS_DUTY = 'pager-duty'
SLACK = 'slack'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AlertIntegrationType from a JSON string"""
return cls(json.loads(json_str))

View File

@ -0,0 +1,88 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class AssignEnterpriseAgentClusterRequest(BaseModel):
"""
AssignEnterpriseAgentClusterRequest
""" # noqa: E501
agents: Optional[List[StrictStr]] = Field(default=None, description="Contains list of agent IDs (get `agentId` from `/agents` endpoint)")
__properties: ClassVar[List[str]] = ["agents"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of AssignEnterpriseAgentClusterRequest 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of AssignEnterpriseAgentClusterRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"agents": obj.get("agents")
})
return _obj

View File

@ -0,0 +1,140 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
from inspect import getfullargspec
import json
import pprint
import re # noqa: F401
from typing import Optional
from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator
from agents_api.models.agent import Agent
from agents_api.models.enterprise_agent import EnterpriseAgent
from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal
from pydantic import StrictStr, Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
CLOUDENTERPRISEAGENT_ANY_OF_SCHEMAS = ["Agent", "EnterpriseAgent"]
class CloudEnterpriseAgent(BaseModel):
"""
CloudEnterpriseAgent
"""
# data type: Agent
anyof_schema_1_validator: Optional[Agent] = None
# data type: EnterpriseAgent
anyof_schema_2_validator: Optional[EnterpriseAgent] = None
if TYPE_CHECKING:
actual_instance: Optional[Union[Agent, EnterpriseAgent]] = None
else:
actual_instance: Any = None
any_of_schemas: List[str] = Literal[CLOUDENTERPRISEAGENT_ANY_OF_SCHEMAS]
model_config = {
"validate_assignment": True
}
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_anyof(cls, v):
instance = CloudEnterpriseAgent.model_construct()
error_messages = []
# validate data type: Agent
if not isinstance(v, Agent):
error_messages.append(f"Error! Input type `{type(v)}` is not `Agent`")
else:
return v
# validate data type: EnterpriseAgent
if not isinstance(v, EnterpriseAgent):
error_messages.append(f"Error! Input type `{type(v)}` is not `EnterpriseAgent`")
else:
return v
if error_messages:
# no match
raise ValueError("No match found when setting the actual_instance in CloudEnterpriseAgent with anyOf schemas: Agent, EnterpriseAgent. Details: " + ", ".join(error_messages))
else:
return v
@classmethod
def from_dict(cls, obj: dict) -> 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 = []
# anyof_schema_1_validator: Optional[Agent] = None
try:
instance.actual_instance = Agent.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# anyof_schema_2_validator: Optional[EnterpriseAgent] = None
try:
instance.actual_instance = EnterpriseAgent.from_json(json_str)
return instance
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
if error_messages:
# no match
raise ValueError("No match found when deserializing the JSON string into CloudEnterpriseAgent with anyOf schemas: Agent, EnterpriseAgent. Details: " + ", ".join(error_messages))
else:
return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
to_json = getattr(self.actual_instance, "to_json", None)
if callable(to_json):
return self.actual_instance.to_json()
else:
return json.dumps(self.actual_instance)
def to_dict(self) -> Dict:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return "null"
to_json = getattr(self.actual_instance, "to_json", None)
if callable(to_json):
return self.actual_instance.to_dict()
else:
return json.dumps(self.actual_instance)
def to_str(self) -> str:
"""Returns the string representation of the actual instance"""
return pprint.pformat(self.model_dump())

View File

@ -0,0 +1,46 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
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))

View File

@ -0,0 +1,95 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from agents_api.models.cloud_enterprise_agent import CloudEnterpriseAgent
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class CloudEnterpriseAgents(BaseModel):
"""
CloudEnterpriseAgents
""" # noqa: E501
agents: Optional[List[CloudEnterpriseAgent]] = None
__properties: ClassVar[List[str]] = ["agents"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of CloudEnterpriseAgents 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
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: Dict) -> Self:
"""Create an instance of CloudEnterpriseAgents from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"agents": [CloudEnterpriseAgent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None
})
return _obj

View File

@ -0,0 +1,131 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr
from pydantic import Field
from agents_api.models.enterprise_agent_state import EnterpriseAgentState
from agents_api.models.error_detail import ErrorDetail
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class ClusterMember(BaseModel):
"""
ClusterMember
""" # noqa: E501
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agents public IP.")
member_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the cluster member", alias="memberId")
name: Optional[StrictStr] = Field(default=None, description="Name of the cluster member")
error_details: Optional[List[ErrorDetail]] = Field(default=None, description="If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only)", alias="errorDetails")
last_seen: Optional[datetime] = Field(default=None, description="UTC last seen date (ISO date-time format).", alias="lastSeen")
agent_state: Optional[EnterpriseAgentState] = Field(default=None, alias="agentState")
target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests")
utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).")
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "memberId", "name", "errorDetails", "lastSeen", "agentState", "targetForTests", "utilization"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of ClusterMember 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.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"ip_addresses",
"public_ip_addresses",
"network",
"member_id",
"name",
"error_details",
"last_seen",
"utilization",
},
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in error_details (list)
_items = []
if self.error_details:
for _item in self.error_details:
if _item:
_items.append(_item.to_dict())
_dict['errorDetails'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of ClusterMember from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ipAddresses": obj.get("ipAddresses"),
"publicIpAddresses": obj.get("publicIpAddresses"),
"network": obj.get("network"),
"memberId": obj.get("memberId"),
"name": obj.get("name"),
"errorDetails": [ErrorDetail.from_dict(_item) for _item in obj.get("errorDetails")] if obj.get("errorDetails") is not None else None,
"lastSeen": obj.get("lastSeen"),
"agentState": obj.get("agentState"),
"targetForTests": obj.get("targetForTests"),
"utilization": obj.get("utilization")
})
return _obj

View File

@ -0,0 +1,199 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
from pydantic import Field
from agents_api.models.account_group import AccountGroup
from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
from agents_api.models.cluster_member import ClusterMember
from agents_api.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy
from agents_api.models.enterprise_agent_state import EnterpriseAgentState
from agents_api.models.error_detail import ErrorDetail
from agents_api.models.interface_ip_mapping import InterfaceIpMapping
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class EnterpriseAgent(BaseModel):
"""
EnterpriseAgent
""" # noqa: E501
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agents public IP.")
agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId")
agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName")
agent_type: Optional[CloudEnterpriseAgentType] = Field(default=None, alias="agentType")
location: Optional[StrictStr] = Field(default=None, description="Location of the agent.")
country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId")
enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.")
verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates")
cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers")
utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).")
account_groups: Optional[List[AccountGroup]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups")
prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.")
ipv6_policy: Optional[EnterpriseAgentIpv6Policy] = Field(default=None, alias="ipv6Policy")
error_details: Optional[List[ErrorDetail]] = Field(default=None, description="If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only)", alias="errorDetails")
hostname: Optional[StrictStr] = Field(default=None, description="Fully qualified domain name of the agent (Enterprise Agents only)")
last_seen: Optional[datetime] = Field(default=None, description="UTC last seen date (ISO date-time format).", alias="lastSeen")
agent_state: Optional[EnterpriseAgentState] = Field(default=None, alias="agentState")
keep_browser_cache: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent retains cache.", alias="keepBrowserCache")
created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate")
target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests")
local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes")
interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings")
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "agentType", "location", "countryId", "enabled", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "prefix", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of EnterpriseAgent 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.
* 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.
* 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"ip_addresses",
"public_ip_addresses",
"network",
"agent_id",
"location",
"country_id",
"verify_ssl_certificates",
"cluster_members",
"utilization",
"prefix",
"error_details",
"hostname",
"last_seen",
"created_date",
"interface_ip_mappings",
},
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list)
_items = []
if self.cluster_members:
for _item in self.cluster_members:
if _item:
_items.append(_item.to_dict())
_dict['clusterMembers'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in account_groups (list)
_items = []
if self.account_groups:
for _item in self.account_groups:
if _item:
_items.append(_item.to_dict())
_dict['accountGroups'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in error_details (list)
_items = []
if self.error_details:
for _item in self.error_details:
if _item:
_items.append(_item.to_dict())
_dict['errorDetails'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list)
_items = []
if self.interface_ip_mappings:
for _item in self.interface_ip_mappings:
if _item:
_items.append(_item.to_dict())
_dict['interfaceIpMappings'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of EnterpriseAgent from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ipAddresses": obj.get("ipAddresses"),
"publicIpAddresses": obj.get("publicIpAddresses"),
"network": obj.get("network"),
"agentId": obj.get("agentId"),
"agentName": obj.get("agentName"),
"agentType": obj.get("agentType"),
"location": obj.get("location"),
"countryId": obj.get("countryId"),
"enabled": obj.get("enabled"),
"verifySslCertificates": obj.get("verifySslCertificates"),
"clusterMembers": [ClusterMember.from_dict(_item) for _item in obj.get("clusterMembers")] if obj.get("clusterMembers") is not None else None,
"utilization": obj.get("utilization"),
"accountGroups": [AccountGroup.from_dict(_item) for _item in obj.get("accountGroups")] if obj.get("accountGroups") is not None else None,
"prefix": obj.get("prefix"),
"ipv6Policy": obj.get("ipv6Policy"),
"errorDetails": [ErrorDetail.from_dict(_item) for _item in obj.get("errorDetails")] if obj.get("errorDetails") is not None else None,
"hostname": obj.get("hostname"),
"lastSeen": obj.get("lastSeen"),
"agentState": obj.get("agentState"),
"keepBrowserCache": obj.get("keepBrowserCache"),
"createdDate": obj.get("createdDate"),
"targetForTests": obj.get("targetForTests"),
"localResolutionPrefixes": obj.get("localResolutionPrefixes"),
"interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj.get("interfaceIpMappings")] if obj.get("interfaceIpMappings") is not None else None
})
return _obj

View File

@ -0,0 +1,231 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
from pydantic import Field
from agents_api.models.account_group import AccountGroup
from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
from agents_api.models.cluster_member import ClusterMember
from agents_api.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy
from agents_api.models.enterprise_agent_state import EnterpriseAgentState
from agents_api.models.error_detail import ErrorDetail
from agents_api.models.interface_ip_mapping import InterfaceIpMapping
from agents_api.models.labels import Labels
from agents_api.models.notification_rules import NotificationRules
from agents_api.models.simple_test import SimpleTest
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class EnterpriseAgentDetail(BaseModel):
"""
EnterpriseAgentDetail
""" # noqa: E501
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agents public IP.")
agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId")
agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName")
agent_type: Optional[CloudEnterpriseAgentType] = Field(default=None, alias="agentType")
location: Optional[StrictStr] = Field(default=None, description="Location of the agent.")
country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId")
enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.")
verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates")
cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers")
utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).")
account_groups: Optional[List[AccountGroup]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups")
prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.")
ipv6_policy: Optional[EnterpriseAgentIpv6Policy] = Field(default=None, alias="ipv6Policy")
error_details: Optional[List[ErrorDetail]] = Field(default=None, description="If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only)", alias="errorDetails")
hostname: Optional[StrictStr] = Field(default=None, description="Fully qualified domain name of the agent (Enterprise Agents only)")
last_seen: Optional[datetime] = Field(default=None, description="UTC last seen date (ISO date-time format).", alias="lastSeen")
agent_state: Optional[EnterpriseAgentState] = Field(default=None, alias="agentState")
keep_browser_cache: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent retains cache.", alias="keepBrowserCache")
created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate")
target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests")
local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes")
interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings")
tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.")
notification_rules: Optional[List[NotificationRules]] = Field(default=None, description="List of notification rule objects configured on agent", alias="notificationRules")
labels: Optional[List[Labels]] = Field(default=None, description="List of labels. See `/labels` for more information.")
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "agentType", "location", "countryId", "enabled", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "prefix", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings", "tests", "notificationRules", "labels"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of EnterpriseAgentDetail 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.
* 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.
* 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.
* OpenAPI `readOnly` fields are excluded.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"ip_addresses",
"public_ip_addresses",
"network",
"agent_id",
"location",
"country_id",
"verify_ssl_certificates",
"cluster_members",
"utilization",
"prefix",
"error_details",
"hostname",
"last_seen",
"created_date",
"interface_ip_mappings",
"labels",
},
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list)
_items = []
if self.cluster_members:
for _item in self.cluster_members:
if _item:
_items.append(_item.to_dict())
_dict['clusterMembers'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in account_groups (list)
_items = []
if self.account_groups:
for _item in self.account_groups:
if _item:
_items.append(_item.to_dict())
_dict['accountGroups'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in error_details (list)
_items = []
if self.error_details:
for _item in self.error_details:
if _item:
_items.append(_item.to_dict())
_dict['errorDetails'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list)
_items = []
if self.interface_ip_mappings:
for _item in self.interface_ip_mappings:
if _item:
_items.append(_item.to_dict())
_dict['interfaceIpMappings'] = _items
# 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
# override the default output from pydantic by calling `to_dict()` of each item in notification_rules (list)
_items = []
if self.notification_rules:
for _item in self.notification_rules:
if _item:
_items.append(_item.to_dict())
_dict['notificationRules'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in labels (list)
_items = []
if self.labels:
for _item in self.labels:
if _item:
_items.append(_item.to_dict())
_dict['labels'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of EnterpriseAgentDetail from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ipAddresses": obj.get("ipAddresses"),
"publicIpAddresses": obj.get("publicIpAddresses"),
"network": obj.get("network"),
"agentId": obj.get("agentId"),
"agentName": obj.get("agentName"),
"agentType": obj.get("agentType"),
"location": obj.get("location"),
"countryId": obj.get("countryId"),
"enabled": obj.get("enabled"),
"verifySslCertificates": obj.get("verifySslCertificates"),
"clusterMembers": [ClusterMember.from_dict(_item) for _item in obj.get("clusterMembers")] if obj.get("clusterMembers") is not None else None,
"utilization": obj.get("utilization"),
"accountGroups": [AccountGroup.from_dict(_item) for _item in obj.get("accountGroups")] if obj.get("accountGroups") is not None else None,
"prefix": obj.get("prefix"),
"ipv6Policy": obj.get("ipv6Policy"),
"errorDetails": [ErrorDetail.from_dict(_item) for _item in obj.get("errorDetails")] if obj.get("errorDetails") is not None else None,
"hostname": obj.get("hostname"),
"lastSeen": obj.get("lastSeen"),
"agentState": obj.get("agentState"),
"keepBrowserCache": obj.get("keepBrowserCache"),
"createdDate": obj.get("createdDate"),
"targetForTests": obj.get("targetForTests"),
"localResolutionPrefixes": obj.get("localResolutionPrefixes"),
"interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj.get("interfaceIpMappings")] if obj.get("interfaceIpMappings") is not None else None,
"tests": [SimpleTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None,
"notificationRules": [NotificationRules.from_dict(_item) for _item in obj.get("notificationRules")] if obj.get("notificationRules") is not None else None,
"labels": [Labels.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None
})
return _obj

View File

@ -0,0 +1,46 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class EnterpriseAgentIpv6Policy(str, Enum):
"""
IP version policy, (Enterprise Agents and Enterprise Clusters only)
"""
"""
allowed enum values
"""
FORCE_MINUS_IPV4 = 'force-ipv4'
PREFER_MINUS_IPV6 = 'prefer-ipv6'
FORCE_MINUS_IPV6 = 'force-ipv6'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of EnterpriseAgentIpv6Policy from a JSON string"""
return cls(json.loads(json_str))

View File

@ -0,0 +1,103 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictStr
from pydantic import Field
from agents_api.models.agent_ipv6_policy import AgentIpv6Policy
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class EnterpriseAgentRequestBody(BaseModel):
"""
EnterpriseAgentRequestBody
""" # noqa: E501
agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName")
enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.")
account_groups: Optional[List[StrictStr]] = Field(default=None, description="Contains a list of account groups IDs. See `/accounts-groups` for a list of account IDs", alias="accountGroups")
ipv6_policy: Optional[AgentIpv6Policy] = Field(default=None, alias="ipv6Policy")
keep_browser_cache: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent retains cache.", alias="keepBrowserCache")
target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests")
local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="Public IP ranges for rDNS lookups. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes")
tests: Optional[List[StrictStr]] = Field(default=None, description="Contains list of test IDs. See `/tests` to pull a list of available tests.")
__properties: ClassVar[List[str]] = ["agentName", "enabled", "accountGroups", "ipv6Policy", "keepBrowserCache", "targetForTests", "localResolutionPrefixes", "tests"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of EnterpriseAgentRequestBody 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of EnterpriseAgentRequestBody from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"agentName": obj.get("agentName"),
"enabled": obj.get("enabled"),
"accountGroups": obj.get("accountGroups"),
"ipv6Policy": obj.get("ipv6Policy"),
"keepBrowserCache": obj.get("keepBrowserCache"),
"targetForTests": obj.get("targetForTests"),
"localResolutionPrefixes": obj.get("localResolutionPrefixes"),
"tests": obj.get("tests")
})
return _obj

View File

@ -0,0 +1,46 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class EnterpriseAgentState(str, Enum):
"""
State of the agent.
"""
"""
allowed enum values
"""
ONLINE = 'online'
OFFLINE = 'offline'
DISABLED = 'disabled'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of EnterpriseAgentState from a JSON string"""
return cls(json.loads(json_str))

View File

@ -0,0 +1,96 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictInt, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
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 = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> 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

View File

@ -0,0 +1,93 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
from agents_api.models.error_detail_code import ErrorDetailCode
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class ErrorDetail(BaseModel):
"""
ErrorDetail
""" # noqa: E501
code: Optional[ErrorDetailCode] = None
description: Optional[StrictStr] = Field(default=None, description="Description for the agent error.")
__properties: ClassVar[List[str]] = ["code", "description"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of ErrorDetail 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"description",
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of ErrorDetail 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"),
"description": obj.get("description")
})
return _obj

View File

@ -0,0 +1,51 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class ErrorDetailCode(str, Enum):
"""
Code for the agent error.
"""
"""
allowed enum values
"""
AGENT_MINUS_VERSION_MINUS_OUTDATED = 'agent-version-outdated'
BROWSERBOT_MINUS_VERSION_MINUS_OUTDATED = 'browserbot-version-outdated'
APPLIANCE_MINUS_VERSION_MINUS_OUTDATED = 'appliance-version-outdated'
CLOCK_MINUS_OFFSET = 'clock-offset'
OS_MINUS_END_MINUS_OF_MINUS_INSTALLATION_MINUS_SUPPORT = 'os-end-of-installation-support'
OS_MINUS_END_MINUS_OF_MINUS_SUPPORT = 'os-end-of-support'
OS_MINUS_END_MINUS_OF_MINUS_LIFE = 'os-end-of-life'
NAT_MINUS_TRAVERSAL_MINUS_ERROR = 'nat-traversal-error'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of ErrorDetailCode from a JSON string"""
return cls(json.loads(json_str))

View File

@ -0,0 +1,237 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
from pydantic import Field
from agents_api.models.account_group import AccountGroup
from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
from agents_api.models.cluster_member import ClusterMember
from agents_api.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy
from agents_api.models.enterprise_agent_state import EnterpriseAgentState
from agents_api.models.error_detail import ErrorDetail
from agents_api.models.interface_ip_mapping import InterfaceIpMapping
from agents_api.models.labels import Labels
from agents_api.models.notification_rules import NotificationRules
from agents_api.models.self_links_links import SelfLinksLinks
from agents_api.models.simple_test import SimpleTest
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class GetAgentDetails200Response(BaseModel):
"""
GetAgentDetails200Response
""" # noqa: E501
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agents public IP.")
agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId")
agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName")
agent_type: Optional[CloudEnterpriseAgentType] = Field(default=None, alias="agentType")
location: Optional[StrictStr] = Field(default=None, description="Location of the agent.")
country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId")
enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.")
verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates")
cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers")
utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).")
account_groups: Optional[List[AccountGroup]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups")
prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.")
ipv6_policy: Optional[EnterpriseAgentIpv6Policy] = Field(default=None, alias="ipv6Policy")
error_details: Optional[List[ErrorDetail]] = Field(default=None, description="If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only)", alias="errorDetails")
hostname: Optional[StrictStr] = Field(default=None, description="Fully qualified domain name of the agent (Enterprise Agents only)")
last_seen: Optional[datetime] = Field(default=None, description="UTC last seen date (ISO date-time format).", alias="lastSeen")
agent_state: Optional[EnterpriseAgentState] = Field(default=None, alias="agentState")
keep_browser_cache: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent retains cache.", alias="keepBrowserCache")
created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate")
target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests")
local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes")
interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings")
tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.")
notification_rules: Optional[List[NotificationRules]] = Field(default=None, description="List of notification rule objects configured on agent", alias="notificationRules")
labels: Optional[List[Labels]] = Field(default=None, description="List of labels - see `/labels` for more information.")
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "agentType", "location", "countryId", "enabled", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "prefix", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings", "tests", "notificationRules", "labels", "_links"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of GetAgentDetails200Response 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.
* 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.
* 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.
* OpenAPI `readOnly` fields are excluded.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"ip_addresses",
"public_ip_addresses",
"network",
"agent_id",
"location",
"country_id",
"verify_ssl_certificates",
"cluster_members",
"utilization",
"prefix",
"error_details",
"hostname",
"last_seen",
"created_date",
"interface_ip_mappings",
"labels",
},
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list)
_items = []
if self.cluster_members:
for _item in self.cluster_members:
if _item:
_items.append(_item.to_dict())
_dict['clusterMembers'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in account_groups (list)
_items = []
if self.account_groups:
for _item in self.account_groups:
if _item:
_items.append(_item.to_dict())
_dict['accountGroups'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in error_details (list)
_items = []
if self.error_details:
for _item in self.error_details:
if _item:
_items.append(_item.to_dict())
_dict['errorDetails'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list)
_items = []
if self.interface_ip_mappings:
for _item in self.interface_ip_mappings:
if _item:
_items.append(_item.to_dict())
_dict['interfaceIpMappings'] = _items
# 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
# override the default output from pydantic by calling `to_dict()` of each item in notification_rules (list)
_items = []
if self.notification_rules:
for _item in self.notification_rules:
if _item:
_items.append(_item.to_dict())
_dict['notificationRules'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in labels (list)
_items = []
if self.labels:
for _item in self.labels:
if _item:
_items.append(_item.to_dict())
_dict['labels'] = _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: Dict) -> Self:
"""Create an instance of GetAgentDetails200Response from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ipAddresses": obj.get("ipAddresses"),
"publicIpAddresses": obj.get("publicIpAddresses"),
"network": obj.get("network"),
"agentId": obj.get("agentId"),
"agentName": obj.get("agentName"),
"agentType": obj.get("agentType"),
"location": obj.get("location"),
"countryId": obj.get("countryId"),
"enabled": obj.get("enabled"),
"verifySslCertificates": obj.get("verifySslCertificates"),
"clusterMembers": [ClusterMember.from_dict(_item) for _item in obj.get("clusterMembers")] if obj.get("clusterMembers") is not None else None,
"utilization": obj.get("utilization"),
"accountGroups": [AccountGroup.from_dict(_item) for _item in obj.get("accountGroups")] if obj.get("accountGroups") is not None else None,
"prefix": obj.get("prefix"),
"ipv6Policy": obj.get("ipv6Policy"),
"errorDetails": [ErrorDetail.from_dict(_item) for _item in obj.get("errorDetails")] if obj.get("errorDetails") is not None else None,
"hostname": obj.get("hostname"),
"lastSeen": obj.get("lastSeen"),
"agentState": obj.get("agentState"),
"keepBrowserCache": obj.get("keepBrowserCache"),
"createdDate": obj.get("createdDate"),
"targetForTests": obj.get("targetForTests"),
"localResolutionPrefixes": obj.get("localResolutionPrefixes"),
"interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj.get("interfaceIpMappings")] if obj.get("interfaceIpMappings") is not None else None,
"tests": [SimpleTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None,
"notificationRules": [NotificationRules.from_dict(_item) for _item in obj.get("notificationRules")] if obj.get("notificationRules") is not None else None,
"labels": [Labels.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None,
"_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None
})
return _obj

View File

@ -0,0 +1,102 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from pydantic import Field
from agents_api.models.agent_proxy import AgentProxy
from agents_api.models.self_links_links import SelfLinksLinks
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class GetAgentProxies200Response(BaseModel):
"""
GetAgentProxies200Response
""" # noqa: E501
agent_proxies: Optional[List[AgentProxy]] = Field(default=None, alias="agentProxies")
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
__properties: ClassVar[List[str]] = ["agentProxies", "_links"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of GetAgentProxies200Response 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in agent_proxies (list)
_items = []
if self.agent_proxies:
for _item in self.agent_proxies:
if _item:
_items.append(_item.to_dict())
_dict['agentProxies'] = _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: Dict) -> Self:
"""Create an instance of GetAgentProxies200Response from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"agentProxies": [AgentProxy.from_dict(_item) for _item in obj.get("agentProxies")] if obj.get("agentProxies") is not None else None,
"_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None
})
return _obj

View File

@ -0,0 +1,102 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from pydantic import Field
from agents_api.models.cloud_enterprise_agent import CloudEnterpriseAgent
from agents_api.models.self_links_links import SelfLinksLinks
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class GetAgents200Response(BaseModel):
"""
GetAgents200Response
""" # noqa: E501
agents: Optional[List[CloudEnterpriseAgent]] = None
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
__properties: ClassVar[List[str]] = ["agents", "_links"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of GetAgents200Response 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
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
# 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: Dict) -> Self:
"""Create an instance of GetAgents200Response from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"agents": [CloudEnterpriseAgent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None,
"_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None
})
return _obj

View File

@ -0,0 +1,120 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictStr
from pydantic import Field
from agents_api.models.agent import Agent
from agents_api.models.notification import Notification
from agents_api.models.self_links_links import SelfLinksLinks
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class GetAgentsNotificationRule200Response(BaseModel):
"""
GetAgentsNotificationRule200Response
""" # noqa: E501
rule_id: Optional[StrictStr] = Field(default=None, description="Agent notification rule ID", alias="ruleId")
rule_name: Optional[StrictStr] = Field(default=None, description="Name of the agent notification rule", alias="ruleName")
expression: Optional[StrictStr] = Field(default=None, description="Expression of agent notification rule")
notify_on_clear: Optional[StrictBool] = Field(default=None, description="Send notification when notification clears", alias="notifyOnClear")
is_default: Optional[StrictBool] = Field(default=None, description="Agent notification rule will be automatically included on all new Enterprise Agents.", alias="isDefault")
agents: Optional[List[Agent]] = None
notifications: Optional[Notification] = None
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
__properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "notifyOnClear", "isDefault", "agents", "notifications", "_links"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of GetAgentsNotificationRule200Response 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"rule_id",
},
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
# override the default output from pydantic by calling `to_dict()` of notifications
if self.notifications:
_dict['notifications'] = self.notifications.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: Dict) -> Self:
"""Create an instance of GetAgentsNotificationRule200Response from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ruleId": obj.get("ruleId"),
"ruleName": obj.get("ruleName"),
"expression": obj.get("expression"),
"notifyOnClear": obj.get("notifyOnClear"),
"isDefault": obj.get("isDefault"),
"agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None,
"notifications": Notification.from_dict(obj.get("notifications")) if obj.get("notifications") is not None else None,
"_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None
})
return _obj

View File

@ -0,0 +1,102 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from pydantic import Field
from agents_api.models.notification_rule import NotificationRule
from agents_api.models.self_links_links import SelfLinksLinks
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class GetAgentsNotificationRules200Response(BaseModel):
"""
GetAgentsNotificationRules200Response
""" # noqa: E501
agent_alert_rules: Optional[List[NotificationRule]] = Field(default=None, alias="agentAlertRules")
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
__properties: ClassVar[List[str]] = ["agentAlertRules", "_links"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of GetAgentsNotificationRules200Response 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in agent_alert_rules (list)
_items = []
if self.agent_alert_rules:
for _item in self.agent_alert_rules:
if _item:
_items.append(_item.to_dict())
_dict['agentAlertRules'] = _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: Dict) -> Self:
"""Create an instance of GetAgentsNotificationRules200Response from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"agentAlertRules": [NotificationRule.from_dict(_item) for _item in obj.get("agentAlertRules")] if obj.get("agentAlertRules") is not None else None,
"_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None
})
return _obj

View File

@ -0,0 +1,94 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class InterfaceIpMapping(BaseModel):
"""
InterfaceIpMapping
""" # noqa: E501
interface_name: Optional[StrictStr] = Field(default=None, description="Name of the mapping", alias="interfaceName")
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of ipAddress entries", alias="ipAddresses")
__properties: ClassVar[List[str]] = ["interfaceName", "ipAddresses"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of InterfaceIpMapping 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"interface_name",
"ip_addresses",
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of InterfaceIpMapping from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"interfaceName": obj.get("interfaceName"),
"ipAddresses": obj.get("ipAddresses")
})
return _obj

View File

@ -0,0 +1,90 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class Labels(BaseModel):
"""
Labels
""" # noqa: E501
label_id: Optional[StrictStr] = Field(default=None, description="Label Id.", alias="labelId")
name: Optional[StrictStr] = Field(default=None, description="Name of the label.")
__properties: ClassVar[List[str]] = ["labelId", "name"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of Labels 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of Labels from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"labelId": obj.get("labelId"),
"name": obj.get("name")
})
return _obj

View File

@ -0,0 +1,102 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
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 = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> 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

View File

@ -0,0 +1,111 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from pydantic import Field
from agents_api.models.alert_email import AlertEmail
from agents_api.models.alert_integration_base import AlertIntegrationBase
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class Notification(BaseModel):
"""
Alert notification object.
""" # noqa: E501
email: Optional[AlertEmail] = None
third_party: Optional[List[AlertIntegrationBase]] = Field(default=None, alias="thirdParty")
webhook: Optional[List[AlertIntegrationBase]] = None
__properties: ClassVar[List[str]] = ["email", "thirdParty", "webhook"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of Notification 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of email
if self.email:
_dict['email'] = self.email.to_dict()
# override the default output from pydantic by calling `to_dict()` of each item in third_party (list)
_items = []
if self.third_party:
for _item in self.third_party:
if _item:
_items.append(_item.to_dict())
_dict['thirdParty'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in webhook (list)
_items = []
if self.webhook:
for _item in self.webhook:
if _item:
_items.append(_item.to_dict())
_dict['webhook'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of Notification from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"email": AlertEmail.from_dict(obj.get("email")) if obj.get("email") is not None else None,
"thirdParty": [AlertIntegrationBase.from_dict(_item) for _item in obj.get("thirdParty")] if obj.get("thirdParty") is not None else None,
"webhook": [AlertIntegrationBase.from_dict(_item) for _item in obj.get("webhook")] if obj.get("webhook") is not None else None
})
return _obj

View File

@ -0,0 +1,98 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class NotificationRule(BaseModel):
"""
NotificationRule
""" # noqa: E501
rule_id: Optional[StrictStr] = Field(default=None, description="Agent notification rule ID", alias="ruleId")
rule_name: Optional[StrictStr] = Field(default=None, description="Name of the agent notification rule", alias="ruleName")
expression: Optional[StrictStr] = Field(default=None, description="Expression of agent notification rule")
notify_on_clear: Optional[StrictBool] = Field(default=None, description="Send notification when notification clears", alias="notifyOnClear")
is_default: Optional[StrictBool] = Field(default=None, description="Agent notification rule will be automatically included on all new Enterprise Agents.", alias="isDefault")
__properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "notifyOnClear", "isDefault"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of NotificationRule 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"rule_id",
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of NotificationRule from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ruleId": obj.get("ruleId"),
"ruleName": obj.get("ruleName"),
"expression": obj.get("expression"),
"notifyOnClear": obj.get("notifyOnClear"),
"isDefault": obj.get("isDefault")
})
return _obj

View File

@ -0,0 +1,114 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictStr
from pydantic import Field
from agents_api.models.agent import Agent
from agents_api.models.notification import Notification
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class NotificationRuleDetail(BaseModel):
"""
NotificationRuleDetail
""" # noqa: E501
rule_id: Optional[StrictStr] = Field(default=None, description="Agent notification rule ID", alias="ruleId")
rule_name: Optional[StrictStr] = Field(default=None, description="Name of the agent notification rule", alias="ruleName")
expression: Optional[StrictStr] = Field(default=None, description="Expression of agent notification rule")
notify_on_clear: Optional[StrictBool] = Field(default=None, description="Send notification when notification clears", alias="notifyOnClear")
is_default: Optional[StrictBool] = Field(default=None, description="Agent notification rule will be automatically included on all new Enterprise Agents.", alias="isDefault")
agents: Optional[List[Agent]] = None
notifications: Optional[Notification] = None
__properties: ClassVar[List[str]] = ["ruleId", "ruleName", "expression", "notifyOnClear", "isDefault", "agents", "notifications"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of NotificationRuleDetail 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"rule_id",
},
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
# override the default output from pydantic by calling `to_dict()` of notifications
if self.notifications:
_dict['notifications'] = self.notifications.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of NotificationRuleDetail from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ruleId": obj.get("ruleId"),
"ruleName": obj.get("ruleName"),
"expression": obj.get("expression"),
"notifyOnClear": obj.get("notifyOnClear"),
"isDefault": obj.get("isDefault"),
"agents": [Agent.from_dict(_item) for _item in obj.get("agents")] if obj.get("agents") is not None else None,
"notifications": Notification.from_dict(obj.get("notifications")) if obj.get("notifications") is not None else None
})
return _obj

View File

@ -0,0 +1,96 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from pydantic import Field
from agents_api.models.notification_rule import NotificationRule
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class NotificationRules(BaseModel):
"""
NotificationRules
""" # noqa: E501
agent_alert_rules: Optional[List[NotificationRule]] = Field(default=None, alias="agentAlertRules")
__properties: ClassVar[List[str]] = ["agentAlertRules"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of NotificationRules 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in agent_alert_rules (list)
_items = []
if self.agent_alert_rules:
for _item in self.agent_alert_rules:
if _item:
_items.append(_item.to_dict())
_dict['agentAlertRules'] = _items
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of NotificationRules from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"agentAlertRules": [NotificationRule.from_dict(_item) for _item in obj.get("agentAlertRules")] if obj.get("agentAlertRules") is not None else None
})
return _obj

View File

@ -0,0 +1,91 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from agents_api.models.notification import Notification
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class Notifications(BaseModel):
"""
Notifications
""" # noqa: E501
notifications: Optional[Notification] = None
__properties: ClassVar[List[str]] = ["notifications"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of Notifications 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of notifications
if self.notifications:
_dict['notifications'] = self.notifications.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of Notifications from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"notifications": Notification.from_dict(obj.get("notifications")) if obj.get("notifications") is not None else None
})
return _obj

View File

@ -0,0 +1,47 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class ProxyAuthType(str, Enum):
"""
The type of authentication the proxy requires
"""
"""
allowed enum values
"""
BASIC = 'basic'
NTLM = 'ntlm'
KERBEROS = 'kerberos'
UNKNOWN = 'unknown'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of ProxyAuthType from a JSON string"""
return cls(json.loads(json_str))

View File

@ -0,0 +1,45 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class ProxyType(str, Enum):
"""
The type of proxy, STATIC or PAC.
"""
"""
allowed enum values
"""
STATIC = 'static'
PAC = 'pac'
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of ProxyType from a JSON string"""
return cls(json.loads(json_str))

View File

@ -0,0 +1,92 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from pydantic import Field
from agents_api.models.self_links_links import SelfLinksLinks
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class SelfLinks(BaseModel):
"""
SelfLinks
""" # noqa: E501
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
__properties: ClassVar[List[str]] = ["_links"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
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: Dict) -> 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({
"_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None
})
return _obj

View File

@ -0,0 +1,92 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from pydantic import Field
from agents_api.models.link import Link
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class SelfLinksLinks(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 = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of SelfLinksLinks 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
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: Dict) -> Self:
"""Create an instance of SelfLinksLinks 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.get("self")) if obj.get("self") is not None else None
})
return _obj

View File

@ -0,0 +1,134 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictStr
from pydantic import Field
from agents_api.models.test_interval import TestInterval
from agents_api.models.test_type import TestType
from agents_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class SimpleTest(BaseModel):
"""
Each test includes additional fields depending on its `type`. Refer `/tests/{type}` endpoint to know the set of fields returned by a given `type`.
""" # noqa: E501
interval: Optional[TestInterval] = None
alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled")
enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.")
created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId")
test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
type: Optional[TestType] = None
links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links")
__properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled", "createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of SimpleTest 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.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"created_by",
"created_date",
"live_share",
"modified_by",
"modified_date",
"saved_event",
"test_id",
},
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: Dict) -> Self:
"""Create an instance of SimpleTest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"interval": obj.get("interval"),
"alertsEnabled": obj.get("alertsEnabled"),
"enabled": obj.get("enabled") if obj.get("enabled") is not None else True,
"createdBy": obj.get("createdBy"),
"createdDate": obj.get("createdDate"),
"description": obj.get("description"),
"liveShare": obj.get("liveShare"),
"modifiedBy": obj.get("modifiedBy"),
"modifiedDate": obj.get("modifiedDate"),
"savedEvent": obj.get("savedEvent"),
"testId": obj.get("testId"),
"testName": obj.get("testName"),
"type": obj.get("type"),
"_links": UnexpandedInstantTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None
})
return _obj

View File

@ -0,0 +1,50 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class TestInterval(int, Enum):
"""
Interval between test runs in seconds.
"""
"""
allowed enum values
"""
NUMBER_60 = 60
NUMBER_120 = 120
NUMBER_300 = 300
NUMBER_600 = 600
NUMBER_900 = 900
NUMBER_1800 = 1800
NUMBER_3600 = 3600
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of TestInterval from a JSON string"""
return cls(json.loads(json_str))

View File

@ -0,0 +1,55 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
import json
import pprint
import re # noqa: F401
from enum import Enum
try:
from typing import Self
except ImportError:
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
"""
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))

View File

@ -0,0 +1,88 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class UnassignEnterpriseAgentFromClusterRequest(BaseModel):
"""
UnassignEnterpriseAgentFromClusterRequest
""" # noqa: E501
members: Optional[List[StrictStr]] = Field(default=None, description="Contains list of member IDs. (get `memberId` from `/agents/{agentId}` endpoint)")
__properties: ClassVar[List[str]] = ["members"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of UnassignEnterpriseAgentFromClusterRequest 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of UnassignEnterpriseAgentFromClusterRequest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"members": obj.get("members")
})
return _obj

View File

@ -0,0 +1,89 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictStr
try:
from typing import Self
except ImportError:
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 = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> 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

View File

@ -0,0 +1,127 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictStr
from pydantic import Field
from agents_api.models.test_type import TestType
from agents_api.models.unexpanded_instant_test_links import UnexpandedInstantTestLinks
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class UnexpandedInstantTest(BaseModel):
"""
UnexpandedInstantTest
""" # noqa: E501
created_by: Optional[StrictStr] = Field(default=None, description="User that created the test.", alias="createdBy")
created_date: Optional[datetime] = Field(default=None, description="UTC created date (ISO date-time format).", alias="createdDate")
description: Optional[StrictStr] = Field(default=None, description="A description of the test.")
live_share: Optional[StrictBool] = Field(default=None, description="Indicates if the test is shared with the account group.", alias="liveShare")
modified_by: Optional[StrictStr] = Field(default=None, description="User that modified the test.", alias="modifiedBy")
modified_date: Optional[datetime] = Field(default=None, description="UTC last modification date (ISO date-time format).", alias="modifiedDate")
saved_event: Optional[StrictBool] = Field(default=None, description="Indicates if the test is a saved event.", alias="savedEvent")
test_id: Optional[StrictStr] = Field(default=None, description="Each test is assigned an unique ID; this is used to access test information and results from other endpoints.", alias="testId")
test_name: Optional[StrictStr] = Field(default=None, description="The name of the test. Test name must be unique.", alias="testName")
type: Optional[TestType] = None
links: Optional[UnexpandedInstantTestLinks] = Field(default=None, alias="_links")
__properties: ClassVar[List[str]] = ["createdBy", "createdDate", "description", "liveShare", "modifiedBy", "modifiedDate", "savedEvent", "testId", "testName", "type", "_links"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of UnexpandedInstantTest 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.
* OpenAPI `readOnly` fields are excluded.
* OpenAPI `readOnly` fields are excluded.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"created_by",
"created_date",
"live_share",
"modified_by",
"modified_date",
"saved_event",
"test_id",
},
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: Dict) -> Self:
"""Create an instance of UnexpandedInstantTest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"createdBy": obj.get("createdBy"),
"createdDate": obj.get("createdDate"),
"description": obj.get("description"),
"liveShare": obj.get("liveShare"),
"modifiedBy": obj.get("modifiedBy"),
"modifiedDate": obj.get("modifiedDate"),
"savedEvent": obj.get("savedEvent"),
"testId": obj.get("testId"),
"testName": obj.get("testName"),
"type": obj.get("type"),
"_links": UnexpandedInstantTestLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None
})
return _obj

View File

@ -0,0 +1,98 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel
from pydantic import Field
from agents_api.models.unexpanded_instant_test_links_self import UnexpandedInstantTestLinksSelf
from agents_api.models.unexpanded_instant_test_links_test_results import UnexpandedInstantTestLinksTestResults
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class UnexpandedInstantTestLinks(BaseModel):
"""
A list of links that can be accessed to get more information
""" # noqa: E501
var_self: Optional[UnexpandedInstantTestLinksSelf] = Field(default=None, alias="self")
test_results: Optional[UnexpandedInstantTestLinksTestResults] = Field(default=None, alias="testResults")
__properties: ClassVar[List[str]] = ["self", "testResults"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of UnexpandedInstantTestLinks 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
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()
# override the default output from pydantic by calling `to_dict()` of test_results
if self.test_results:
_dict['testResults'] = self.test_results.to_dict()
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of UnexpandedInstantTestLinks from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"self": UnexpandedInstantTestLinksSelf.from_dict(obj.get("self")) if obj.get("self") is not None else None,
"testResults": UnexpandedInstantTestLinksTestResults.from_dict(obj.get("testResults")) if obj.get("testResults") is not None else None
})
return _obj

View File

@ -0,0 +1,102 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictStr
from pydantic import Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class UnexpandedInstantTestLinksSelf(BaseModel):
"""
UnexpandedInstantTestLinksSelf
""" # 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 = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of UnexpandedInstantTestLinksSelf 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of UnexpandedInstantTestLinksSelf 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

View File

@ -0,0 +1,149 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
from __future__ import annotations
from inspect import getfullargspec
import json
import pprint
import re # noqa: F401
from typing import Any, List, Optional
from pydantic import BaseModel, Field, StrictStr, ValidationError, field_validator
from pydantic import Field
from agents_api.models.link import Link
from typing import Union, Any, List, TYPE_CHECKING, Optional, Dict
from typing_extensions import Literal
from pydantic import StrictStr, Field
try:
from typing import Self
except ImportError:
from typing_extensions import Self
UNEXPANDEDINSTANTTESTLINKSTESTRESULTS_ONE_OF_SCHEMAS = ["Link", "List[Link]"]
class UnexpandedInstantTestLinksTestResults(BaseModel):
"""
UnexpandedInstantTestLinksTestResults
"""
# data type: List[Link]
oneof_schema_1_validator: Optional[List[Link]] = Field(default=None, description="Reference to the test results.")
# data type: Link
oneof_schema_2_validator: Optional[Link] = None
actual_instance: Optional[Union[Link, List[Link]]] = None
one_of_schemas: List[str] = Literal["Link", "List[Link]"]
model_config = {
"validate_assignment": True
}
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 = UnexpandedInstantTestLinksTestResults.model_construct()
error_messages = []
match = 0
# validate data type: List[Link]
try:
instance.oneof_schema_1_validator = v
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# validate data type: Link
if not isinstance(v, Link):
error_messages.append(f"Error! Input type `{type(v)}` is not `Link`")
else:
match += 1
if match > 1:
# more than 1 match
raise ValueError("Multiple matches found when setting `actual_instance` in UnexpandedInstantTestLinksTestResults with oneOf schemas: Link, List[Link]. Details: " + ", ".join(error_messages))
elif match == 0:
# no match
raise ValueError("No match found when setting `actual_instance` in UnexpandedInstantTestLinksTestResults with oneOf schemas: Link, List[Link]. Details: " + ", ".join(error_messages))
else:
return v
@classmethod
def from_dict(cls, obj: dict) -> 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 List[Link]
try:
# validation
instance.oneof_schema_1_validator = json.loads(json_str)
# assign value to actual_instance
instance.actual_instance = instance.oneof_schema_1_validator
match += 1
except (ValidationError, ValueError) as e:
error_messages.append(str(e))
# deserialize data into Link
try:
instance.actual_instance = Link.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 UnexpandedInstantTestLinksTestResults with oneOf schemas: Link, List[Link]. Details: " + ", ".join(error_messages))
elif match == 0:
# no match
raise ValueError("No match found when deserializing the JSON string into UnexpandedInstantTestLinksTestResults with oneOf schemas: Link, List[Link]. Details: " + ", ".join(error_messages))
else:
return instance
def to_json(self) -> str:
"""Returns the JSON representation of the actual instance"""
if self.actual_instance is None:
return "null"
to_json = getattr(self.actual_instance, "to_json", None)
if callable(to_json):
return self.actual_instance.to_json()
else:
return json.dumps(self.actual_instance)
def to_dict(self) -> Dict:
"""Returns the dict representation of the actual instance"""
if self.actual_instance is None:
return None
to_dict = getattr(self.actual_instance, "to_dict", None)
if callable(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())

View File

@ -0,0 +1,93 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool
from pydantic import Field
from agents_api.models.test_interval import TestInterval
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class UnexpandedTest(BaseModel):
"""
UnexpandedTest
""" # noqa: E501
interval: Optional[TestInterval] = None
alerts_enabled: Optional[StrictBool] = Field(default=None, description="Indicates if alerts are enabled.", alias="alertsEnabled")
enabled: Optional[StrictBool] = Field(default=True, description="Test is enabled.")
__properties: ClassVar[List[str]] = ["interval", "alertsEnabled", "enabled"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of UnexpandedTest 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.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
},
exclude_none=True,
)
return _dict
@classmethod
def from_dict(cls, obj: Dict) -> Self:
"""Create an instance of UnexpandedTest from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"interval": obj.get("interval"),
"alertsEnabled": obj.get("alertsEnabled"),
"enabled": obj.get("enabled") if obj.get("enabled") is not None else True
})
return _obj

View File

@ -0,0 +1,237 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
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 typing import Any, ClassVar, Dict, List, Optional
from pydantic import BaseModel, StrictBool, StrictInt, StrictStr
from pydantic import Field
from agents_api.models.account_group import AccountGroup
from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
from agents_api.models.cluster_member import ClusterMember
from agents_api.models.enterprise_agent_ipv6_policy import EnterpriseAgentIpv6Policy
from agents_api.models.enterprise_agent_state import EnterpriseAgentState
from agents_api.models.error_detail import ErrorDetail
from agents_api.models.interface_ip_mapping import InterfaceIpMapping
from agents_api.models.labels import Labels
from agents_api.models.notification_rules import NotificationRules
from agents_api.models.self_links_links import SelfLinksLinks
from agents_api.models.simple_test import SimpleTest
try:
from typing import Self
except ImportError:
from typing_extensions import Self
class UpdateEnterpriseAgentDetails200Response(BaseModel):
"""
UpdateEnterpriseAgentDetails200Response
""" # noqa: E501
ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of private IP addresses.", alias="ipAddresses")
public_ip_addresses: Optional[List[StrictStr]] = Field(default=None, description="Array of public IP addresses.", alias="publicIpAddresses")
network: Optional[StrictStr] = Field(default=None, description="Network (including ASN) of agents public IP.")
agent_id: Optional[StrictStr] = Field(default=None, description="Unique ID of the agent.", alias="agentId")
agent_name: Optional[StrictStr] = Field(default=None, description="Name of the agent.", alias="agentName")
agent_type: Optional[CloudEnterpriseAgentType] = Field(default=None, alias="agentType")
location: Optional[StrictStr] = Field(default=None, description="Location of the agent.")
country_id: Optional[StrictStr] = Field(default=None, description="2-digit ISO country code", alias="countryId")
enabled: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent is enabled.")
verify_ssl_certificates: Optional[StrictBool] = Field(default=None, description="Flag indicating if has normal SSL operations or if instead it's set to ignore SSL errors on browserbot-based tests.", alias="verifySslCertificates")
cluster_members: Optional[List[ClusterMember]] = Field(default=None, description="If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents.", alias="clusterMembers")
utilization: Optional[StrictInt] = Field(default=None, description="Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only).")
account_groups: Optional[List[AccountGroup]] = Field(default=None, description="List of account groups. See /accounts-groups to pull a list of account IDs", alias="accountGroups")
prefix: Optional[StrictStr] = Field(default=None, description="Prefix containing agents public IP address.")
ipv6_policy: Optional[EnterpriseAgentIpv6Policy] = Field(default=None, alias="ipv6Policy")
error_details: Optional[List[ErrorDetail]] = Field(default=None, description="If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only)", alias="errorDetails")
hostname: Optional[StrictStr] = Field(default=None, description="Fully qualified domain name of the agent (Enterprise Agents only)")
last_seen: Optional[datetime] = Field(default=None, description="UTC last seen date (ISO date-time format).", alias="lastSeen")
agent_state: Optional[EnterpriseAgentState] = Field(default=None, alias="agentState")
keep_browser_cache: Optional[StrictBool] = Field(default=None, description="Flag indicating if the agent retains cache.", alias="keepBrowserCache")
created_date: Optional[datetime] = Field(default=None, description="UTC Agent creation date (ISO date-time format).", alias="createdDate")
target_for_tests: Optional[StrictStr] = Field(default=None, description="Test target IP address.", alias="targetForTests")
local_resolution_prefixes: Optional[List[StrictStr]] = Field(default=None, description="To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only).", alias="localResolutionPrefixes")
interface_ip_mappings: Optional[List[InterfaceIpMapping]] = Field(default=None, alias="interfaceIpMappings")
tests: Optional[List[SimpleTest]] = Field(default=None, description="List of tests. See `/tests` for more information.")
notification_rules: Optional[List[NotificationRules]] = Field(default=None, description="List of notification rule objects configured on agent", alias="notificationRules")
labels: Optional[List[Labels]] = Field(default=None, description="List of labels. See `/labels` for more information.")
links: Optional[SelfLinksLinks] = Field(default=None, alias="_links")
__properties: ClassVar[List[str]] = ["ipAddresses", "publicIpAddresses", "network", "agentId", "agentName", "agentType", "location", "countryId", "enabled", "verifySslCertificates", "clusterMembers", "utilization", "accountGroups", "prefix", "ipv6Policy", "errorDetails", "hostname", "lastSeen", "agentState", "keepBrowserCache", "createdDate", "targetForTests", "localResolutionPrefixes", "interfaceIpMappings", "tests", "notificationRules", "labels", "_links"]
model_config = {
"populate_by_name": True,
"validate_assignment": True
}
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 json.dumps(self.to_dict())
@classmethod
def from_json(cls, json_str: str) -> Self:
"""Create an instance of UpdateEnterpriseAgentDetails200Response 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.
* 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.
* 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.
* OpenAPI `readOnly` fields are excluded.
"""
_dict = self.model_dump(
by_alias=True,
exclude={
"ip_addresses",
"public_ip_addresses",
"network",
"agent_id",
"location",
"country_id",
"verify_ssl_certificates",
"cluster_members",
"utilization",
"prefix",
"error_details",
"hostname",
"last_seen",
"created_date",
"interface_ip_mappings",
"labels",
},
exclude_none=True,
)
# override the default output from pydantic by calling `to_dict()` of each item in cluster_members (list)
_items = []
if self.cluster_members:
for _item in self.cluster_members:
if _item:
_items.append(_item.to_dict())
_dict['clusterMembers'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in account_groups (list)
_items = []
if self.account_groups:
for _item in self.account_groups:
if _item:
_items.append(_item.to_dict())
_dict['accountGroups'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in error_details (list)
_items = []
if self.error_details:
for _item in self.error_details:
if _item:
_items.append(_item.to_dict())
_dict['errorDetails'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in interface_ip_mappings (list)
_items = []
if self.interface_ip_mappings:
for _item in self.interface_ip_mappings:
if _item:
_items.append(_item.to_dict())
_dict['interfaceIpMappings'] = _items
# 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
# override the default output from pydantic by calling `to_dict()` of each item in notification_rules (list)
_items = []
if self.notification_rules:
for _item in self.notification_rules:
if _item:
_items.append(_item.to_dict())
_dict['notificationRules'] = _items
# override the default output from pydantic by calling `to_dict()` of each item in labels (list)
_items = []
if self.labels:
for _item in self.labels:
if _item:
_items.append(_item.to_dict())
_dict['labels'] = _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: Dict) -> Self:
"""Create an instance of UpdateEnterpriseAgentDetails200Response from a dict"""
if obj is None:
return None
if not isinstance(obj, dict):
return cls.model_validate(obj)
_obj = cls.model_validate({
"ipAddresses": obj.get("ipAddresses"),
"publicIpAddresses": obj.get("publicIpAddresses"),
"network": obj.get("network"),
"agentId": obj.get("agentId"),
"agentName": obj.get("agentName"),
"agentType": obj.get("agentType"),
"location": obj.get("location"),
"countryId": obj.get("countryId"),
"enabled": obj.get("enabled"),
"verifySslCertificates": obj.get("verifySslCertificates"),
"clusterMembers": [ClusterMember.from_dict(_item) for _item in obj.get("clusterMembers")] if obj.get("clusterMembers") is not None else None,
"utilization": obj.get("utilization"),
"accountGroups": [AccountGroup.from_dict(_item) for _item in obj.get("accountGroups")] if obj.get("accountGroups") is not None else None,
"prefix": obj.get("prefix"),
"ipv6Policy": obj.get("ipv6Policy"),
"errorDetails": [ErrorDetail.from_dict(_item) for _item in obj.get("errorDetails")] if obj.get("errorDetails") is not None else None,
"hostname": obj.get("hostname"),
"lastSeen": obj.get("lastSeen"),
"agentState": obj.get("agentState"),
"keepBrowserCache": obj.get("keepBrowserCache"),
"createdDate": obj.get("createdDate"),
"targetForTests": obj.get("targetForTests"),
"localResolutionPrefixes": obj.get("localResolutionPrefixes"),
"interfaceIpMappings": [InterfaceIpMapping.from_dict(_item) for _item in obj.get("interfaceIpMappings")] if obj.get("interfaceIpMappings") is not None else None,
"tests": [SimpleTest.from_dict(_item) for _item in obj.get("tests")] if obj.get("tests") is not None else None,
"notificationRules": [NotificationRules.from_dict(_item) for _item in obj.get("notificationRules")] if obj.get("notificationRules") is not None else None,
"labels": [Labels.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None,
"_links": SelfLinksLinks.from_dict(obj.get("_links")) if obj.get("_links") is not None else None
})
return _obj

View File

View File

@ -0,0 +1,231 @@
# coding: utf-8
"""
Agents API
## Overview Manage all agents available to your account in ThousandEyes, including both Cloud and Enterprise Agents.
The version of the OpenAPI document: 7.0.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import io
import json
import re
import ssl
import urllib3
from agents_api.exceptions import ApiException, ApiValueError
RESTResponseType = urllib3.HTTPResponse
class RESTResponse(io.IOBase):
def __init__(self, resp) -> None:
self.response = resp
self.status = resp.status
self.reason = resp.reason
self.data = None
def read(self):
if self.data is None:
self.data = self.response.data
return self.data
def getheaders(self):
"""Returns a dictionary of the response headers."""
return self.response.headers
def getheader(self, name, default=None):
"""Returns a given response header."""
return self.response.headers.get(name, default)
class RESTClientObject:
def __init__(self, configuration) -> None:
# urllib3.PoolManager will pass all kw parameters to connectionpool
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501
# https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501
# Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501
# cert_reqs
if configuration.verify_ssl:
cert_reqs = ssl.CERT_REQUIRED
else:
cert_reqs = ssl.CERT_NONE
addition_pool_args = {}
if configuration.assert_hostname is not None:
addition_pool_args['assert_hostname'] = (
configuration.assert_hostname
)
if configuration.retries is not None:
addition_pool_args['retries'] = configuration.retries
if configuration.tls_server_name:
addition_pool_args['server_hostname'] = configuration.tls_server_name
if configuration.socket_options is not None:
addition_pool_args['socket_options'] = configuration.socket_options
# https pool manager
if configuration.proxy:
self.pool_manager = urllib3.ProxyManager(
cert_reqs=cert_reqs,
ca_certs=configuration.ssl_ca_cert,
cert_file=configuration.cert_file,
key_file=configuration.key_file,
proxy_url=configuration.proxy,
proxy_headers=configuration.proxy_headers,
**addition_pool_args
)
else:
self.pool_manager = urllib3.PoolManager(
cert_reqs=cert_reqs,
ca_certs=configuration.ssl_ca_cert,
cert_file=configuration.cert_file,
key_file=configuration.key_file,
**addition_pool_args
)
def request(
self,
method,
url,
headers=None,
body=None,
post_params=None,
_request_timeout=None
):
"""Perform requests.
:param method: http request method
:param url: http request url
:param headers: http request headers
:param body: request json body, for `application/json`
:param post_params: request post parameters,
`application/x-www-form-urlencoded`
and `multipart/form-data`
: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.
"""
method = method.upper()
assert method in [
'GET',
'HEAD',
'DELETE',
'POST',
'PUT',
'PATCH',
'OPTIONS'
]
if post_params and body:
raise ApiValueError(
"body parameter cannot be used with post_params parameter."
)
post_params = post_params or {}
headers = headers or {}
timeout = None
if _request_timeout:
if isinstance(_request_timeout, (int, float)):
timeout = urllib3.Timeout(total=_request_timeout)
elif (
isinstance(_request_timeout, tuple)
and len(_request_timeout) == 2
):
timeout = urllib3.Timeout(
connect=_request_timeout[0],
read=_request_timeout[1]
)
try:
# For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE`
if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']:
# no content type provided or payload is json
content_type = headers.get('Content-Type')
if (
not content_type
or re.search('json', content_type, re.IGNORECASE)
):
request_body = None
if body is not None:
request_body = json.dumps(body)
r = self.pool_manager.request(
method,
url,
body=request_body,
timeout=timeout,
headers=headers,
preload_content=False
)
elif content_type == 'application/x-www-form-urlencoded':
r = self.pool_manager.request(
method,
url,
fields=post_params,
encode_multipart=False,
timeout=timeout,
headers=headers,
preload_content=False
)
elif content_type == 'multipart/form-data':
# must del headers['Content-Type'], or the correct
# Content-Type which generated by urllib3 will be
# overwritten.
del headers['Content-Type']
r = self.pool_manager.request(
method,
url,
fields=post_params,
encode_multipart=True,
timeout=timeout,
headers=headers,
preload_content=False
)
# Pass a `string` parameter directly in the body to support
# other content types than Json when `body` argument is
# provided in serialized form
elif isinstance(body, str) or isinstance(body, bytes):
request_body = body
r = self.pool_manager.request(
method,
url,
body=request_body,
timeout=timeout,
headers=headers,
preload_content=False
)
else:
# Cannot generate the request from given parameters
msg = """Cannot prepare a request message for provided
arguments. Please check that your arguments match
declared content type."""
raise ApiException(status=0, reason=msg)
# For `GET`, `HEAD`
else:
r = self.pool_manager.request(
method,
url,
fields={},
timeout=timeout,
headers=headers,
preload_content=False
)
except urllib3.exceptions.SSLError as e:
msg = "\n".join([type(e).__name__, str(e)])
raise ApiException(status=0, reason=msg)
return RESTResponse(r)

View File

@ -0,0 +1,29 @@
# AccountGroup
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**aid** | **str** | A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. | [optional]
**account_group_name** | **str** | Account group name | [optional]
## Example
```python
from agents_api.models.account_group import AccountGroup
# TODO update the JSON string below
json = "{}"
# create an instance of AccountGroup from a JSON string
account_group_instance = AccountGroup.from_json(json)
# print the JSON string representation of the object
print AccountGroup.to_json()
# convert the object into a dict
account_group_dict = account_group_instance.to_dict()
# create an instance of AccountGroup from a dict
account_group_form_dict = account_group.from_dict(account_group_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)

View File

@ -0,0 +1,28 @@
# AccountGroupId
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**aid** | **str** | A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; endpoint. | [optional]
## Example
```python
from agents_api.models.account_group_id import AccountGroupId
# TODO update the JSON string below
json = "{}"
# create an instance of AccountGroupId from a JSON string
account_group_id_instance = AccountGroupId.from_json(json)
# print the JSON string representation of the object
print AccountGroupId.to_json()
# convert the object into a dict
account_group_id_dict = account_group_id_instance.to_dict()
# create an instance of AccountGroupId from a dict
account_group_id_form_dict = account_group_id.from_dict(account_group_id_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)

37
agents_api/docs/Agent.md Normal file
View File

@ -0,0 +1,37 @@
# Agent
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly]
**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly]
**network** | **str** | Network (including ASN) of agents public IP. | [optional] [readonly]
**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly]
**agent_name** | **str** | Name of the agent. | [optional]
**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | [optional]
**location** | **str** | Location of the agent. | [optional] [readonly]
**country_id** | **str** | 2-digit ISO country code | [optional] [readonly]
**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional]
**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it&#39;s set to ignore SSL errors on browserbot-based tests. | [optional] [readonly]
## Example
```python
from agents_api.models.agent import Agent
# TODO update the JSON string below
json = "{}"
# create an instance of Agent from a JSON string
agent_instance = Agent.from_json(json)
# print the JSON string representation of the object
print Agent.to_json()
# convert the object into a dict
agent_dict = agent_instance.to_dict()
# create an instance of Agent from a dict
agent_form_dict = agent.from_dict(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)

View File

@ -0,0 +1,30 @@
# AgentBase
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly]
**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly]
**network** | **str** | Network (including ASN) of agents public IP. | [optional] [readonly]
## Example
```python
from agents_api.models.agent_base import AgentBase
# TODO update the JSON string below
json = "{}"
# create an instance of AgentBase from a JSON string
agent_base_instance = AgentBase.from_json(json)
# print the JSON string representation of the object
print AgentBase.to_json()
# convert the object into a dict
agent_base_dict = agent_base_instance.to_dict()
# create an instance of AgentBase from a dict
agent_base_form_dict = agent_base.from_dict(agent_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)

View File

@ -0,0 +1,39 @@
# AgentDetail
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly]
**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly]
**network** | **str** | Network (including ASN) of agents public IP. | [optional] [readonly]
**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly]
**agent_name** | **str** | Name of the agent. | [optional]
**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | [optional]
**location** | **str** | Location of the agent. | [optional] [readonly]
**country_id** | **str** | 2-digit ISO country code | [optional] [readonly]
**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional]
**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it&#39;s set to ignore SSL errors on browserbot-based tests. | [optional] [readonly]
**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See &#x60;/tests&#x60; for more information. | [optional]
**labels** | [**List[Labels]**](Labels.md) | List of labels - see &#x60;/labels&#x60; for more information. | [optional] [readonly]
## Example
```python
from agents_api.models.agent_detail import AgentDetail
# TODO update the JSON string below
json = "{}"
# create an instance of AgentDetail from a JSON string
agent_detail_instance = AgentDetail.from_json(json)
# print the JSON string representation of the object
print AgentDetail.to_json()
# convert the object into a dict
agent_detail_dict = agent_detail_instance.to_dict()
# create an instance of AgentDetail from a dict
agent_detail_form_dict = agent_detail.from_dict(agent_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)

View File

@ -0,0 +1,54 @@
# AgentDetails
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly]
**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly]
**network** | **str** | Network (including ASN) of agents public IP. | [optional] [readonly]
**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly]
**agent_name** | **str** | Name of the agent. | [optional]
**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | [optional]
**location** | **str** | Location of the agent. | [optional] [readonly]
**country_id** | **str** | 2-digit ISO country code | [optional] [readonly]
**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional]
**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it&#39;s set to ignore SSL errors on browserbot-based tests. | [optional] [readonly]
**cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly]
**utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly]
**account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional]
**prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly]
**ipv6_policy** | [**EnterpriseAgentIpv6Policy**](EnterpriseAgentIpv6Policy.md) | | [optional]
**error_details** | [**List[ErrorDetail]**](ErrorDetail.md) | If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only) | [optional] [readonly]
**hostname** | **str** | Fully qualified domain name of the agent (Enterprise Agents only) | [optional] [readonly]
**last_seen** | **datetime** | UTC last seen date (ISO date-time format). | [optional] [readonly]
**agent_state** | [**EnterpriseAgentState**](EnterpriseAgentState.md) | | [optional]
**keep_browser_cache** | **bool** | Flag indicating if the agent retains cache. | [optional]
**created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly]
**target_for_tests** | **str** | Test target IP address. | [optional]
**local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional]
**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly]
**tests** | [**List[SimpleTest]**](SimpleTest.md) | List of tests. See &#x60;/tests&#x60; for more information. | [optional]
**notification_rules** | [**List[NotificationRules]**](NotificationRules.md) | List of notification rule objects configured on agent | [optional]
**labels** | [**List[Labels]**](Labels.md) | List of labels - see &#x60;/labels&#x60; for more information. | [optional] [readonly]
## Example
```python
from agents_api.models.agent_details import AgentDetails
# TODO update the JSON string below
json = "{}"
# create an instance of AgentDetails from a JSON string
agent_details_instance = AgentDetails.from_json(json)
# print the JSON string representation of the object
print AgentDetails.to_json()
# convert the object into a dict
agent_details_dict = agent_details_instance.to_dict()
# create an instance of AgentDetails from a dict
agent_details_form_dict = agent_details.from_dict(agent_details_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)

View File

@ -0,0 +1,10 @@
# AgentDetailsExpand
## 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)

View File

@ -0,0 +1,11 @@
# AgentIpv6Policy
IP version policy, (Enterprise Agents and Enterprise Clusters only)
## 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)

View File

@ -0,0 +1,10 @@
# AgentListExpand
## 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)

View File

@ -0,0 +1,28 @@
# AgentProxies
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**agent_proxies** | [**List[AgentProxy]**](AgentProxy.md) | | [optional]
## Example
```python
from agents_api.models.agent_proxies import AgentProxies
# TODO update the JSON string below
json = "{}"
# create an instance of AgentProxies from a JSON string
agent_proxies_instance = AgentProxies.from_json(json)
# print the JSON string representation of the object
print AgentProxies.to_json()
# convert the object into a dict
agent_proxies_dict = agent_proxies_instance.to_dict()
# create an instance of AgentProxies from a dict
agent_proxies_form_dict = agent_proxies.from_dict(agent_proxies_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)

View File

@ -0,0 +1,38 @@
# AgentProxy
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**aid** | **str** | Account id that this proxy configuration belongs to | [optional]
**auth_type** | [**ProxyAuthType**](ProxyAuthType.md) | | [optional]
**bypass_list** | **List[str]** | A list of hostnames, network prefixes, or wildcards used to determine which test targets should not be proxied. If all tests should be proxied, leave empty. | [optional]
**last_modified** | **datetime** | Last modification timestamp of the proxy. Expressed in UTC (ISO date-time format). | [optional]
**location** | **str** | The location of the proxy. If proxyType is &#x60;static&#x60; use the format &#x60;hostname:port&#x60;. If location is &#x60;pac&#x60;, then specify the URL where the PAC file can be obtained. | [optional]
**is_local_configured** | **bool** | Set to &#x60;true&#x60; if this proxy configuration comes from the agents config file. Specify &#x60;false&#x60; if the proxy configuration was created in the ThousandEyes application. | [optional]
**name** | **str** | Expression of agent notification rule. | [optional]
**password** | **str** | Password for proxy authentication | [optional]
**proxy_id** | **str** | Agent proxy&#39;s unique ID. | [optional]
**type** | [**ProxyType**](ProxyType.md) | | [optional]
**user** | **str** | Username for proxy authentication. | [optional]
## Example
```python
from agents_api.models.agent_proxy import AgentProxy
# TODO update the JSON string below
json = "{}"
# create an instance of AgentProxy from a JSON string
agent_proxy_instance = AgentProxy.from_json(json)
# print the JSON string representation of the object
print AgentProxy.to_json()
# convert the object into a dict
agent_proxy_dict = agent_proxy_instance.to_dict()
# create an instance of AgentProxy from a dict
agent_proxy_form_dict = agent_proxy.from_dict(agent_proxy_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)

28
agents_api/docs/Agents.md Normal file
View File

@ -0,0 +1,28 @@
# Agents
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**agents** | [**List[Agent]**](Agent.md) | | [optional]
## Example
```python
from agents_api.models.agents import Agents
# TODO update the JSON string below
json = "{}"
# create an instance of Agents from a JSON string
agents_instance = Agents.from_json(json)
# print the JSON string representation of the object
print Agents.to_json()
# convert the object into a dict
agents_dict = agents_instance.to_dict()
# create an instance of Agents from a dict
agents_form_dict = agents.from_dict(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)

View File

@ -0,0 +1,29 @@
# AlertEmail
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**message** | **str** | Message used for email notification. | [optional]
**recipients** | **List[str]** | List of recipients emails that will be notified. | [optional]
## Example
```python
from agents_api.models.alert_email import AlertEmail
# TODO update the JSON string below
json = "{}"
# create an instance of AlertEmail from a JSON string
alert_email_instance = AlertEmail.from_json(json)
# print the JSON string representation of the object
print AlertEmail.to_json()
# convert the object into a dict
alert_email_dict = alert_email_instance.to_dict()
# create an instance of AlertEmail from a dict
alert_email_form_dict = alert_email.from_dict(alert_email_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)

View File

@ -0,0 +1,35 @@
# AlertIntegrationBase
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**integration_id** | **str** | Unique ID of the integration. | [optional]
**integration_name** | **str** | Name of the integration. | [optional]
**integration_type** | [**AlertIntegrationType**](AlertIntegrationType.md) | | [optional]
**target** | **str** | Target URL of the integration. | [optional]
**auth_method** | **str** | (PagerDuty only) Authentication method. | [optional]
**auth_user** | **str** | (PagerDuty only) Authentication user. | [optional]
**auth_token** | **str** | (PagerDuty only) Authentication token. | [optional]
**channel** | **str** | (Slack only) Slack &#x60;#channel&#x60; or &#x60;@user&#x60;. | [optional]
## Example
```python
from agents_api.models.alert_integration_base import AlertIntegrationBase
# TODO update the JSON string below
json = "{}"
# create an instance of AlertIntegrationBase from a JSON string
alert_integration_base_instance = AlertIntegrationBase.from_json(json)
# print the JSON string representation of the object
print AlertIntegrationBase.to_json()
# convert the object into a dict
alert_integration_base_dict = alert_integration_base_instance.to_dict()
# create an instance of AlertIntegrationBase from a dict
alert_integration_base_form_dict = alert_integration_base.from_dict(alert_integration_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)

View File

@ -0,0 +1,11 @@
# AlertIntegrationType
Type of the alert integration
## 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)

View File

@ -0,0 +1,28 @@
# AssignEnterpriseAgentClusterRequest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**agents** | **List[str]** | Contains list of agent IDs (get &#x60;agentId&#x60; from &#x60;/agents&#x60; endpoint) | [optional]
## Example
```python
from agents_api.models.assign_enterprise_agent_cluster_request import AssignEnterpriseAgentClusterRequest
# TODO update the JSON string below
json = "{}"
# create an instance of AssignEnterpriseAgentClusterRequest from a JSON string
assign_enterprise_agent_cluster_request_instance = AssignEnterpriseAgentClusterRequest.from_json(json)
# print the JSON string representation of the object
print AssignEnterpriseAgentClusterRequest.to_json()
# convert the object into a dict
assign_enterprise_agent_cluster_request_dict = assign_enterprise_agent_cluster_request_instance.to_dict()
# create an instance of AssignEnterpriseAgentClusterRequest from a dict
assign_enterprise_agent_cluster_request_form_dict = assign_enterprise_agent_cluster_request.from_dict(assign_enterprise_agent_cluster_request_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)

View File

@ -0,0 +1,180 @@
# agents_api.CloudAndEnterpriseAgentNotificationRulesApi
All URIs are relative to *https://api.thousandeyes.com*
Method | HTTP request | Description
------------- | ------------- | -------------
[**get_agents_notification_rule**](CloudAndEnterpriseAgentNotificationRulesApi.md#get_agents_notification_rule) | **GET** /v7/agents/notification-rules/{notificationRuleId} | Retrieve agent notification rule
[**get_agents_notification_rules**](CloudAndEnterpriseAgentNotificationRulesApi.md#get_agents_notification_rules) | **GET** /v7/agents/notification-rules | List agent notification rules
# **get_agents_notification_rule**
> GetAgentsNotificationRule200Response get_agents_notification_rule(notification_rule_id, aid=aid)
Retrieve agent notification rule
Returns details of an agent notification rule, including agents it is assigned to.
### Example
* Bearer Authentication (BearerAuth):
```python
import time
import os
import agents_api
from agents_api.models.get_agents_notification_rule200_response import GetAgentsNotificationRule200Response
from agents_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = agents_api.Configuration(
host = "https://api.thousandeyes.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = agents_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with agents_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = agents_api.CloudAndEnterpriseAgentNotificationRulesApi(api_client)
notification_rule_id = '281474976710706' # str | Unique ID for the agent notification rule.
aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
try:
# Retrieve agent notification rule
api_response = api_instance.get_agents_notification_rule(notification_rule_id, aid=aid)
print("The response of CloudAndEnterpriseAgentNotificationRulesApi->get_agents_notification_rule:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CloudAndEnterpriseAgentNotificationRulesApi->get_agents_notification_rule: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**notification_rule_id** | **str**| Unique ID for the agent notification rule. |
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; 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
[**GetAgentsNotificationRule200Response**](GetAgentsNotificationRule200Response.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+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_agents_notification_rules**
> GetAgentsNotificationRules200Response get_agents_notification_rules(aid=aid)
List agent notification rules
Returns a list of all agent notification rules configured under the account.
### Example
* Bearer Authentication (BearerAuth):
```python
import time
import os
import agents_api
from agents_api.models.get_agents_notification_rules200_response import GetAgentsNotificationRules200Response
from agents_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = agents_api.Configuration(
host = "https://api.thousandeyes.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = agents_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with agents_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = agents_api.CloudAndEnterpriseAgentNotificationRulesApi(api_client)
aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
try:
# List agent notification rules
api_response = api_instance.get_agents_notification_rules(aid=aid)
print("The response of CloudAndEnterpriseAgentNotificationRulesApi->get_agents_notification_rules:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CloudAndEnterpriseAgentNotificationRulesApi->get_agents_notification_rules: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; 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
[**GetAgentsNotificationRules200Response**](GetAgentsNotificationRules200Response.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+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)

View File

@ -0,0 +1,367 @@
# agents_api.CloudAndEnterpriseAgentsApi
All URIs are relative to *https://api.thousandeyes.com*
Method | HTTP request | Description
------------- | ------------- | -------------
[**delete_enterprise_agent**](CloudAndEnterpriseAgentsApi.md#delete_enterprise_agent) | **DELETE** /v7/agents/{agentId} | Delete Enterprise Agent
[**get_agent_details**](CloudAndEnterpriseAgentsApi.md#get_agent_details) | **GET** /v7/agents/{agentId} | Retrieve Cloud and Enterprise Agent
[**get_agents**](CloudAndEnterpriseAgentsApi.md#get_agents) | **GET** /v7/agents | List Cloud and Enterprise Agents
[**update_enterprise_agent_details**](CloudAndEnterpriseAgentsApi.md#update_enterprise_agent_details) | **PUT** /v7/agents/{agentId} | Update Enterprise Agent
# **delete_enterprise_agent**
> delete_enterprise_agent(agent_id, aid=aid)
Delete Enterprise Agent
Deletes an Enterprise Agent. Important notes related to agent removal: * If an agent is deleted, the modification date for tests using that agent at the time it was deleted will be changed. * If a deleted agent is the final remaining agent on a test, then the test will be disabled when the agent is removed. * If an agent is removed, it must be re-initialized to use the same machine again in different context. Virtual Appliances can be updated using the Reset State button in the Advanced tab of the agent management interface. Users running packaged versions of Linux will need to remove /var/lib/te-agent/\\*.sqlite in order to reinitialize an agent.
### Example
* Bearer Authentication (BearerAuth):
```python
import time
import os
import agents_api
from agents_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = agents_api.Configuration(
host = "https://api.thousandeyes.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = agents_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with agents_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = agents_api.CloudAndEnterpriseAgentsApi(api_client)
agent_id = '281474976710706' # str | Unique ID for the agent.
aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
try:
# Delete Enterprise Agent
api_instance.delete_enterprise_agent(agent_id, aid=aid)
except Exception as e:
print("Exception when calling CloudAndEnterpriseAgentsApi->delete_enterprise_agent: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**agent_id** | **str**| Unique ID for the agent. |
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; 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
void (empty response body)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/problem+json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
**204** | No content | - |
**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_agent_details**
> GetAgentDetails200Response get_agent_details(agent_id, aid=aid, expand=expand)
Retrieve Cloud and Enterprise Agent
Returns details for an agent, including assigned tests. For Enterprise Agents, this endpoint returns additional details, including utilization data, assigned accounts, a list of account groups the agent is assigned to, and utilization details.
### Example
* Bearer Authentication (BearerAuth):
```python
import time
import os
import agents_api
from agents_api.models.agent_details_expand import AgentDetailsExpand
from agents_api.models.get_agent_details200_response import GetAgentDetails200Response
from agents_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = agents_api.Configuration(
host = "https://api.thousandeyes.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = agents_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with agents_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = agents_api.CloudAndEnterpriseAgentsApi(api_client)
agent_id = '281474976710706' # str | Unique ID for the agent.
aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
expand = [agents_api.AgentDetailsExpand()] # List[AgentDetailsExpand] | Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query. (optional)
try:
# Retrieve Cloud and Enterprise Agent
api_response = api_instance.get_agent_details(agent_id, aid=aid, expand=expand)
print("The response of CloudAndEnterpriseAgentsApi->get_agent_details:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CloudAndEnterpriseAgentsApi->get_agent_details: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**agent_id** | **str**| Unique ID for the agent. |
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; 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]
**expand** | [**List[AgentDetailsExpand]**](AgentDetailsExpand.md)| Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the &#x60;clusterMembers&#x60; sub-resource, pass the &#x60;?expand&#x3D;cluster-member&#x60; query. | [optional]
### Return type
[**GetAgentDetails200Response**](GetAgentDetails200Response.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+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_agents**
> GetAgents200Response get_agents(aid=aid, expand=expand, agent_types=agent_types)
List Cloud and Enterprise Agents
Returns a list of all agents available to your ThousandEyes account, including both Enterprise and Cloud Agents. If an agent is an Enterprise Agent, this endpoint returns the agents public and private IP addresses, as well as the public network where the agent is located.
### Example
* Bearer Authentication (BearerAuth):
```python
import time
import os
import agents_api
from agents_api.models.agent_list_expand import AgentListExpand
from agents_api.models.cloud_enterprise_agent_type import CloudEnterpriseAgentType
from agents_api.models.get_agents200_response import GetAgents200Response
from agents_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = agents_api.Configuration(
host = "https://api.thousandeyes.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = agents_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with agents_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = agents_api.CloudAndEnterpriseAgentsApi(api_client)
aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
expand = [agents_api.AgentListExpand()] # List[AgentListExpand] | Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query. (optional)
agent_types = [agents_api.CloudEnterpriseAgentType()] # List[CloudEnterpriseAgentType] | Specifies the type of agent to request. (optional)
try:
# List Cloud and Enterprise Agents
api_response = api_instance.get_agents(aid=aid, expand=expand, agent_types=agent_types)
print("The response of CloudAndEnterpriseAgentsApi->get_agents:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CloudAndEnterpriseAgentsApi->get_agents: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; 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]
**expand** | [**List[AgentListExpand]**](AgentListExpand.md)| Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the &#x60;clusterMembers&#x60; sub-resource, pass the &#x60;?expand&#x3D;cluster-member&#x60; query. | [optional]
**agent_types** | [**List[CloudEnterpriseAgentType]**](CloudEnterpriseAgentType.md)| Specifies the type of agent to request. | [optional]
### Return type
[**GetAgents200Response**](GetAgents200Response.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/hal+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)
# **update_enterprise_agent_details**
> UpdateEnterpriseAgentDetails200Response update_enterprise_agent_details(agent_id, enterprise_agent_request_body, aid=aid, expand=expand)
Update Enterprise Agent
Updates details for an Enterprise Agent. This endpoint can only be used for Enterprise Agents, and only for users in a role that permits modification of Enterprise Agents. Important notes related to agent modification on tests: * if an agent is removed from a test, the modification date for tests using that agent at the time it was removed will be changed. * If an agent is removed from an entire account group, then all tests using this agent in the removed account group will be updated to reflect the removed agent. * If a removed agent is the final remaining agent on a test, then the test will be disabled when the agent is removed. Users can update the following fields: * `agentName`: String representation of an agent. No two agents can have the same display name. * `enabled`: Boolean representation of agent state. * `accountGroups`: An array of account group ids. See `v7/account-groups` to pull a list of account IDs. * `tests`: An array of test Is. See `v7/tests` to retrieve a list tests available in the current account context. * `ipv6Policy`: Enum representation of the IP version policy. * `keepBrowserCache`: Boolean representation of the Keep browser cache state. * `targetForTests`: String representation of the target IP address or domain name. This represents the test destination when agent is acting as a test target in an agent-to-agent test. * `localResolutionPrefixes`: This array of strings represents the public IP ranges where the Enterprise Agent performs rDNS (Reverse DNS) lookups. The range should be in CIDR notation, such as `10.1.1.0/24`. Please note that a maximum of 5 prefixes is allowed. This only applies to Enterprise Agents and Enterprise Agent clusters.
### Example
* Bearer Authentication (BearerAuth):
```python
import time
import os
import agents_api
from agents_api.models.agent_details_expand import AgentDetailsExpand
from agents_api.models.enterprise_agent_request_body import EnterpriseAgentRequestBody
from agents_api.models.update_enterprise_agent_details200_response import UpdateEnterpriseAgentDetails200Response
from agents_api.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.thousandeyes.com
# See configuration.py for a list of all supported configuration parameters.
configuration = agents_api.Configuration(
host = "https://api.thousandeyes.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure Bearer authorization: BearerAuth
configuration = agents_api.Configuration(
access_token = os.environ["BEARER_TOKEN"]
)
# Enter a context with an instance of the API client
with agents_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = agents_api.CloudAndEnterpriseAgentsApi(api_client)
agent_id = '281474976710706' # str | Unique ID for the agent.
enterprise_agent_request_body = agents_api.EnterpriseAgentRequestBody() # EnterpriseAgentRequestBody |
aid = '2067' # str | A unique identifier associated with your account group. You can retrieve your `AccountGroupId` from the `/account-groups` endpoint. Note that you must be assigned to the target account group. Specifying this parameter without being assigned to the target account group will result in an error response. (optional)
expand = [agents_api.AgentDetailsExpand()] # List[AgentDetailsExpand] | Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the `clusterMembers` sub-resource, pass the `?expand=cluster-member` query. (optional)
try:
# Update Enterprise Agent
api_response = api_instance.update_enterprise_agent_details(agent_id, enterprise_agent_request_body, aid=aid, expand=expand)
print("The response of CloudAndEnterpriseAgentsApi->update_enterprise_agent_details:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling CloudAndEnterpriseAgentsApi->update_enterprise_agent_details: %s\n" % e)
```
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**agent_id** | **str**| Unique ID for the agent. |
**enterprise_agent_request_body** | [**EnterpriseAgentRequestBody**](EnterpriseAgentRequestBody.md)| |
**aid** | **str**| A unique identifier associated with your account group. You can retrieve your &#x60;AccountGroupId&#x60; from the &#x60;/account-groups&#x60; 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]
**expand** | [**List[AgentDetailsExpand]**](AgentDetailsExpand.md)| Optional parameter, off by default. Indicates which agent sub-resource to expand. For example, if you wish to expand the &#x60;clusterMembers&#x60; sub-resource, pass the &#x60;?expand&#x3D;cluster-member&#x60; query. | [optional]
### Return type
[**UpdateEnterpriseAgentDetails200Response**](UpdateEnterpriseAgentDetails200Response.md)
### Authorization
[BearerAuth](../README.md#BearerAuth)
### HTTP request headers
- **Content-Type**: application/hal+json
- **Accept**: application/hal+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)

View File

@ -0,0 +1,51 @@
# CloudEnterpriseAgent
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly]
**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly]
**network** | **str** | Network (including ASN) of agents public IP. | [optional] [readonly]
**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly]
**agent_name** | **str** | Name of the agent. | [optional]
**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | [optional]
**location** | **str** | Location of the agent. | [optional] [readonly]
**country_id** | **str** | 2-digit ISO country code | [optional] [readonly]
**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional]
**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it&#39;s set to ignore SSL errors on browserbot-based tests. | [optional] [readonly]
**cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly]
**utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly]
**account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional]
**prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly]
**ipv6_policy** | [**EnterpriseAgentIpv6Policy**](EnterpriseAgentIpv6Policy.md) | | [optional]
**error_details** | [**List[ErrorDetail]**](ErrorDetail.md) | If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only) | [optional] [readonly]
**hostname** | **str** | Fully qualified domain name of the agent (Enterprise Agents only) | [optional] [readonly]
**last_seen** | **datetime** | UTC last seen date (ISO date-time format). | [optional] [readonly]
**agent_state** | [**EnterpriseAgentState**](EnterpriseAgentState.md) | | [optional]
**keep_browser_cache** | **bool** | Flag indicating if the agent retains cache. | [optional]
**created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly]
**target_for_tests** | **str** | Test target IP address. | [optional]
**local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional]
**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly]
## Example
```python
from agents_api.models.cloud_enterprise_agent import CloudEnterpriseAgent
# TODO update the JSON string below
json = "{}"
# create an instance of CloudEnterpriseAgent from a JSON string
cloud_enterprise_agent_instance = CloudEnterpriseAgent.from_json(json)
# print the JSON string representation of the object
print CloudEnterpriseAgent.to_json()
# convert the object into a dict
cloud_enterprise_agent_dict = cloud_enterprise_agent_instance.to_dict()
# create an instance of CloudEnterpriseAgent from a dict
cloud_enterprise_agent_form_dict = cloud_enterprise_agent.from_dict(cloud_enterprise_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)

View File

@ -0,0 +1,11 @@
# 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)

View File

@ -0,0 +1,28 @@
# CloudEnterpriseAgents
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**agents** | [**List[CloudEnterpriseAgent]**](CloudEnterpriseAgent.md) | | [optional]
## Example
```python
from agents_api.models.cloud_enterprise_agents import CloudEnterpriseAgents
# TODO update the JSON string below
json = "{}"
# create an instance of CloudEnterpriseAgents from a JSON string
cloud_enterprise_agents_instance = CloudEnterpriseAgents.from_json(json)
# print the JSON string representation of the object
print CloudEnterpriseAgents.to_json()
# convert the object into a dict
cloud_enterprise_agents_dict = cloud_enterprise_agents_instance.to_dict()
# create an instance of CloudEnterpriseAgents from a dict
cloud_enterprise_agents_form_dict = cloud_enterprise_agents.from_dict(cloud_enterprise_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)

View File

@ -0,0 +1,37 @@
# ClusterMember
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly]
**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly]
**network** | **str** | Network (including ASN) of agents public IP. | [optional] [readonly]
**member_id** | **str** | Unique ID of the cluster member | [optional] [readonly]
**name** | **str** | Name of the cluster member | [optional] [readonly]
**error_details** | [**List[ErrorDetail]**](ErrorDetail.md) | If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only) | [optional] [readonly]
**last_seen** | **datetime** | UTC last seen date (ISO date-time format). | [optional] [readonly]
**agent_state** | [**EnterpriseAgentState**](EnterpriseAgentState.md) | | [optional]
**target_for_tests** | **str** | Test target IP address. | [optional]
**utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly]
## Example
```python
from agents_api.models.cluster_member import ClusterMember
# TODO update the JSON string below
json = "{}"
# create an instance of ClusterMember from a JSON string
cluster_member_instance = ClusterMember.from_json(json)
# print the JSON string representation of the object
print ClusterMember.to_json()
# convert the object into a dict
cluster_member_dict = cluster_member_instance.to_dict()
# create an instance of ClusterMember from a dict
cluster_member_form_dict = cluster_member.from_dict(cluster_member_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)

View File

@ -0,0 +1,51 @@
# EnterpriseAgent
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ip_addresses** | **List[str]** | Array of private IP addresses. | [optional] [readonly]
**public_ip_addresses** | **List[str]** | Array of public IP addresses. | [optional] [readonly]
**network** | **str** | Network (including ASN) of agents public IP. | [optional] [readonly]
**agent_id** | **str** | Unique ID of the agent. | [optional] [readonly]
**agent_name** | **str** | Name of the agent. | [optional]
**agent_type** | [**CloudEnterpriseAgentType**](CloudEnterpriseAgentType.md) | | [optional]
**location** | **str** | Location of the agent. | [optional] [readonly]
**country_id** | **str** | 2-digit ISO country code | [optional] [readonly]
**enabled** | **bool** | Flag indicating if the agent is enabled. | [optional]
**verify_ssl_certificates** | **bool** | Flag indicating if has normal SSL operations or if instead it&#39;s set to ignore SSL errors on browserbot-based tests. | [optional] [readonly]
**cluster_members** | [**List[ClusterMember]**](ClusterMember.md) | If an enterprise agent is clustered, detailed information about each cluster member will be shown as array entries in the clusterMembers field. This field is not shown for Enterprise Agents in standalone mode, or for Cloud Agents. | [optional] [readonly]
**utilization** | **int** | Shows overall utilization percentage (online Enterprise Agents and Enterprise Clusters only). | [optional] [readonly]
**account_groups** | [**List[AccountGroup]**](AccountGroup.md) | List of account groups. See /accounts-groups to pull a list of account IDs | [optional]
**prefix** | **str** | Prefix containing agents public IP address. | [optional] [readonly]
**ipv6_policy** | [**EnterpriseAgentIpv6Policy**](EnterpriseAgentIpv6Policy.md) | | [optional]
**error_details** | [**List[ErrorDetail]**](ErrorDetail.md) | If an enterprise agent or a cluster member presents at least one error, the errors will be shown as an array of entries in the errorDetails field (Enterprise Agents and Enterprise Cluster members only) | [optional] [readonly]
**hostname** | **str** | Fully qualified domain name of the agent (Enterprise Agents only) | [optional] [readonly]
**last_seen** | **datetime** | UTC last seen date (ISO date-time format). | [optional] [readonly]
**agent_state** | [**EnterpriseAgentState**](EnterpriseAgentState.md) | | [optional]
**keep_browser_cache** | **bool** | Flag indicating if the agent retains cache. | [optional]
**created_date** | **datetime** | UTC Agent creation date (ISO date-time format). | [optional] [readonly]
**target_for_tests** | **str** | Test target IP address. | [optional]
**local_resolution_prefixes** | **List[str]** | To perform rDNS lookups for public IP ranges, this field represents the public IP ranges. The range must be in CIDR notation; for example, 10.1.1.0/24. Maximum of 5 prefixes allowed (Enterprise Agents and Enterprise Agent clusters only). | [optional]
**interface_ip_mappings** | [**List[InterfaceIpMapping]**](InterfaceIpMapping.md) | | [optional] [readonly]
## Example
```python
from agents_api.models.enterprise_agent import EnterpriseAgent
# TODO update the JSON string below
json = "{}"
# create an instance of EnterpriseAgent from a JSON string
enterprise_agent_instance = EnterpriseAgent.from_json(json)
# print the JSON string representation of the object
print EnterpriseAgent.to_json()
# convert the object into a dict
enterprise_agent_dict = enterprise_agent_instance.to_dict()
# create an instance of EnterpriseAgent from a dict
enterprise_agent_form_dict = enterprise_agent.from_dict(enterprise_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)

Some files were not shown because too many files have changed in this diff Show More